json-validator-duplicated-keys
v1.0.1
Published
A json handler that has an option to check for duplicated keys
Downloads
93
Maintainers
Readme
A json handler that has an option to check for duplicated keys This is a fork of json-duplicate-key-handle by KhanhTrinh2094 licensed under MIT license Git of original: https://github.com/KhanhTrinh2094/json-duplicate-key-handle NPM page of original: https://www.npmjs.com/package/json-duplicate-key-handle
Install
npm install json-validator-duplicated-keys
Usage
## .validate(jsonString, allowDuplicatedKeys)
Validates a json string and returns error if any, undefined if the json string is valid.
#### jsonString
Type: `String`
JSON string to parse
#### allowDuplicatedKeys
Type: `Boolean`
Default: `false`
Whether duplicated keys are allowed in an object or not