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

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

No files matched your search

@@ -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'}
+13
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;
}