mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add types for json-dup-key-validator (#45543)
This commit is contained in:
parent
2b693605f3
commit
1e67ae1a43
7
types/json-dup-key-validator/index.d.ts
vendored
Normal file
7
types/json-dup-key-validator/index.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// Type definitions for json-dup-key-validator 1.0
|
||||
// Project: https://github.com/jackyjieliu/json-dup-key-validator
|
||||
// Definitions by: Jamie Magee <https://github.com/JamieMagee>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function validate(jsonString: string, allowDuplicatedKeys?: boolean): string | undefined;
|
||||
export function parse(jsonString: string, allowDuplicatedKeys?: boolean): object;
|
||||
@ -0,0 +1,6 @@
|
||||
import * as jsonValidator from 'json-dup-key-validator';
|
||||
|
||||
jsonValidator.parse('{}'); // $ExpectType object
|
||||
jsonValidator.parse('{}', false); // $ExpectType object
|
||||
jsonValidator.validate('{}'); // $ExpectType string | undefined
|
||||
jsonValidator.validate('{}', false); // $ExpectType string | undefined
|
||||
23
types/json-dup-key-validator/tsconfig.json
Normal file
23
types/json-dup-key-validator/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"json-dup-key-validator-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/json-dup-key-validator/tslint.json
Normal file
1
types/json-dup-key-validator/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user