mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-23 11:50:15 +08:00
Merge pull request #7096 from dmoonfire/add-strip-json-comments
Added strip-json-comments as a module.
This commit is contained in:
@@ -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
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user