mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Improve z-schema.d.ts (#9427)
- add `validateSchema` function to the definitions.
This commit is contained in:
committed by
Masahiro Wakame
parent
3a5e413626
commit
e8377d3d50
@@ -21,6 +21,7 @@ var schema: any = {
|
||||
},
|
||||
};
|
||||
|
||||
validator.validateSchema(schema);
|
||||
validator.validate(json, schema);
|
||||
validator.validate(json, schema, function (err: any, valid: boolean) {
|
||||
if (err) {
|
||||
|
||||
Vendored
+6
@@ -39,6 +39,12 @@ declare namespace ZSchema {
|
||||
export class Validator {
|
||||
constructor(options: Options);
|
||||
|
||||
/**
|
||||
* @param schema - JSON object representing schema
|
||||
* @returns {boolean} true if schema is valid.
|
||||
*/
|
||||
validateSchema(schema: any): boolean;
|
||||
|
||||
/**
|
||||
* @param json - either a JSON string or a parsed JSON object
|
||||
* @param schema - the JSON object representing the schema
|
||||
|
||||
Reference in New Issue
Block a user