mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
Merge pull request #18223 from EricByers/master
Add safe-json-stringify type
This commit is contained in:
13
types/safe-json-stringify/index.d.ts
vendored
Normal file
13
types/safe-json-stringify/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for safe-json-stringify 1.0
|
||||
// Project: https://github.com/debitoor/safe-json-stringify
|
||||
// Definitions by: Eric Byers <https://github.com/ericbyers/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped"
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare namespace safeJsonStringify {
|
||||
function ensureProperties(obj: any): object;
|
||||
}
|
||||
|
||||
declare function safeJsonStringify(data: object): string;
|
||||
|
||||
export = safeJsonStringify;
|
||||
5
types/safe-json-stringify/safe-json-stringify-tests.ts
Normal file
5
types/safe-json-stringify/safe-json-stringify-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import safeJsonStringify = require('safe-json-stringify');
|
||||
|
||||
const obj1 = {foo: 'bar'};
|
||||
safeJsonStringify(obj1);
|
||||
safeJsonStringify.ensureProperties(obj1);
|
||||
22
types/safe-json-stringify/tsconfig.json
Normal file
22
types/safe-json-stringify/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"safe-json-stringify-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/safe-json-stringify/tslint.json
Normal file
1
types/safe-json-stringify/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user