Files
DefinitelyTyped/types/strip-json-comments/strip-json-comments-tests.ts
Josh Goldberg 1f267c9f04 Added declared namespace to strip-json-comments (#18595)
Allows it to be imported as an ES2015 module.
2017-08-14 13:17:48 -07:00

17 lines
496 B
TypeScript

// 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/DefinitelyTyped/DefinitelyTyped
import * as stripJsonComments from "strip-json-comments";
const json = '{/*rainbows*/"unicorn":"cake"}';
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
stripJsonComments(json, {});
stripJsonComments(json, {
whitespace: true
});