Merge pull request #7096 from dmoonfire/add-strip-json-comments

Added strip-json-comments as a module.
This commit is contained in:
Masahiro Wakame
2015-12-10 23:06:40 +09:00
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
// Type definitions for strip-json-comments
// Project: https://github.com/sindresorhus/strip-json-comments
// Definitions by: Dylan R. E. Moonfire <https://github.com/dmoonfire/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="strip-json-comments.d.ts" />
import stripJsonComments = require("strip-json-comments");
const json = '{/*rainbows*/"unicorn":"cake"}';
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}

View File

@@ -0,0 +1,13 @@
// Type definitions for strip-json-comments
// Project: https://github.com/sindresorhus/strip-json-comments
// Definitions by: Dylan R. E. Moonfire <https://github.com/dmoonfire/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "strip-json-comments" {
interface StripJsonOptions {
whitespace?: boolean;
}
function stripJsonComments(input: string, opts?: StripJsonOptions): string;
export = stripJsonComments;
}