mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-25 03:20:02 +00:00
Merge pull request #7096 from dmoonfire/add-strip-json-comments
Added strip-json-comments as a module.
This commit is contained in:
11
strip-json-comments/strip-json-comments-tests.ts
Normal file
11
strip-json-comments/strip-json-comments-tests.ts
Normal 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'}
|
||||
13
strip-json-comments/strip-json-comments.d.ts
vendored
Normal file
13
strip-json-comments/strip-json-comments.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user