schema-inspector
Advanced tools
+1
| module.exports = require('./lib/schema-inspector'); |
+4
-4
| { | ||
| "name": "schema-inspector", | ||
| "version": "1.3.5", | ||
| "version": "1.4.6", | ||
| "homepage": "https://github.com/Atinux/schema-inspector", | ||
| "authors": [ | ||
| { | ||
| "name": "Sebastien Chopin", | ||
| "name": "Aaron Blum", | ||
| "email": "atinux@gmail.com", | ||
@@ -13,3 +13,3 @@ "homepage": "https://twitter.com/atinux" | ||
| "description": "Schema-Inspector is a powerful tool to sanitize and validate JS objects.", | ||
| "main": "./lib/schema-inspector.js", | ||
| "main": "index.js", | ||
| "keywords": [ | ||
@@ -32,4 +32,4 @@ "schema-inspector", | ||
| "dependencies": { | ||
| "async": "~0.2.5" | ||
| "async": "*" | ||
| } | ||
| } |
@@ -815,2 +815,4 @@ /* | ||
| strict: function (schema, post) { | ||
| if (schema.strict !== true) | ||
| return post; | ||
| if (!_typeIs['object'](schema.properties)) | ||
@@ -817,0 +819,0 @@ return post; |
+3
-3
| { | ||
| "name": "schema-inspector", | ||
| "description": "Schema-Inspector is a powerful tool to sanitize and validate JS objects.", | ||
| "version": "1.4.5", | ||
| "main": "./lib/schema-inspector.js", | ||
| "version": "1.4.6", | ||
| "main": "index.js", | ||
| "author": { | ||
| "name": "Sebastien Chopin", | ||
| "name": "Aaron Blum", | ||
| "url" : "https://twitter.com/atinux" | ||
@@ -9,0 +9,0 @@ }, |
+37
-0
@@ -155,2 +155,3 @@ [](http://atinux.github.io/schema-inspector/) | ||
| * [minLength, maxLength](#s_length) | ||
| * [strict](#s_strict) | ||
| * [exec](#s_exec) | ||
@@ -1001,2 +1002,38 @@ * [properties](#s_properties) | ||
| <a name="s_strict" /> | ||
| ### strict | ||
| * **type**: boolean. | ||
| * **default**: false. | ||
| * **usable on**: any. | ||
| Only key provided in field "properties" will exist in object, others will be deleted. | ||
| __Example__ | ||
| ```javascript | ||
| var inspector = require('schema-inspector'); | ||
| var schema = { | ||
| type: 'object', | ||
| strict: true, | ||
| properties: { | ||
| good: { type: 'string' } | ||
| } | ||
| }; | ||
| var c = { | ||
| good: 'yes', | ||
| bad: 'nope' | ||
| }; | ||
| var r = inspector.sanitize(schema, c); | ||
| /* | ||
| c: { | ||
| good: 'yes' | ||
| } | ||
| */ | ||
| ``` | ||
| --------------------------------------- | ||
| <a name="s_exec" /> | ||
@@ -1003,0 +1040,0 @@ ### exec |
| var should = require('should'); | ||
| var si = require('../lib/schema-inspector'); | ||
| var si = require('../'); | ||
@@ -4,0 +4,0 @@ const NB_TEST = 25; |
| var should = require('should'); | ||
| var si = require('../lib/schema-inspector'); | ||
| var si = require('../'); | ||
@@ -4,0 +4,0 @@ exports.sanitization = function () { |
| var should = require('should'); | ||
| var si = require('../lib/schema-inspector'); | ||
| var si = require('../'); | ||
@@ -4,0 +4,0 @@ exports.validation = function () { |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
298800
0.17%21
5%5319
0.06%1304
2.92%