Merge pull request #7320 from DavidBR-SW/Update_joi_typings

Updated optional flag on object.assert in Joi typings
This commit is contained in:
Masahiro Wakame
2015-12-27 21:53:08 +09:00
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -579,7 +579,9 @@ objSchema = objSchema.without(str, strArr);
objSchema = objSchema.rename(str, str);
objSchema = objSchema.rename(str, str, renOpts);
objSchema = objSchema.assert(str, schema);
objSchema = objSchema.assert(str, schema, str);
objSchema = objSchema.assert(ref, schema);
objSchema = objSchema.assert(ref, schema, str);
objSchema = objSchema.unknown();
+3 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for joi v4.6.0
// Project: https://github.com/spumko/joi
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Laurence Dougal Myers <https://github.com/laurence-myers>, Christopher Glantschnig <https://github.com/cglantschnig>
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Laurence Dougal Myers <https://github.com/laurence-myers>, Christopher Glantschnig <https://github.com/cglantschnig>, David Broder-Rodgers <https://github.com/DavidBR-SW>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// TODO express type of Schema in a type-parameter (.default, .valid, .example etc)
@@ -584,8 +584,8 @@ declare module 'joi' {
/**
* Verifies an assertion where.
*/
assert(ref: string, schema: Schema, message: string): ObjectSchema;
assert(ref: Reference, schema: Schema, message: string): ObjectSchema;
assert(ref: string, schema: Schema, message?: string): ObjectSchema;
assert(ref: Reference, schema: Schema, message?: string): ObjectSchema;
/**
* Overrides the handling of unknown keys for the scope of the current object only (does not apply to children).