@kenyip/joi
Advanced tools
+1
-1
| { | ||
| "name": "@kenyip/joi", | ||
| "description": "Object schema validation", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "homepage": "https://github.com/hapijs/joi", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/hapijs/joi", |
+25
-25
@@ -7,3 +7,3 @@ # @kenyip/joi | ||
| ```sh | ||
| ```shell | ||
| // Using NPM | ||
@@ -24,4 +24,4 @@ $ npm i @kenyip/joi --save | ||
| const object = Joi.object({ | ||
| hello: Joi.string(), | ||
| world: Joi.string() | ||
| hello: Joi.string(), | ||
| world: Joi.string() | ||
| }); | ||
@@ -32,11 +32,11 @@ | ||
| // { | ||
| // "type": "object", | ||
| // "properties": { | ||
| // "hello": { | ||
| // "type": "string" | ||
| // }, | ||
| // "world": { | ||
| // "type": "string" | ||
| // } | ||
| // } | ||
| // "type": "object", | ||
| // "properties": { | ||
| // "hello": { | ||
| // "type": "string" | ||
| // }, | ||
| // "world": { | ||
| // "type": "string" | ||
| // } | ||
| // } | ||
| // } | ||
@@ -50,9 +50,9 @@ ``` | ||
| const objectA = Joi.object({ | ||
| hello: Joi.string(), | ||
| world: Joi.string(), | ||
| hello: Joi.string(), | ||
| world: Joi.string(), | ||
| }); | ||
| const objectB = objectA | ||
| .keys({ foo: Joi.string() }) | ||
| .remove(["hello"]); | ||
| .keys({ foo: Joi.string() }) | ||
| .remove(["hello"]); | ||
@@ -62,12 +62,12 @@ console.log(JSON.stringify(objectB.toSwagger(), null, 4)); | ||
| // { | ||
| // "type": "object", | ||
| // "properties": { | ||
| // "world": { | ||
| // "type": "string" | ||
| // }, | ||
| // "foo": { | ||
| // "type": "string" | ||
| // } | ||
| // } | ||
| // "type": "object", | ||
| // "properties": { | ||
| // "world": { | ||
| // "type": "string" | ||
| // }, | ||
| // "foo": { | ||
| // "type": "string" | ||
| // } | ||
| // } | ||
| // } | ||
| ``` |
186459
0.02%