Merge pull request #18223 from EricByers/master

Add safe-json-stringify type
This commit is contained in:
Wesley Wigham
2017-07-19 14:26:53 -07:00
committed by GitHub
4 changed files with 41 additions and 0 deletions

13
types/safe-json-stringify/index.d.ts vendored Normal file
View 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;

View File

@@ -0,0 +1,5 @@
import safeJsonStringify = require('safe-json-stringify');
const obj1 = {foo: 'bar'};
safeJsonStringify(obj1);
safeJsonStringify.ensureProperties(obj1);

View 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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }