Files
DefinitelyTyped/types/strip-json-comments/strip-json-comments-tests.ts
2018-02-06 10:31:25 -08:00

12 lines
249 B
TypeScript

import stripJsonComments = require("strip-json-comments");
const json = '{/*rainbows*/"unicorn":"cake"}';
JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
stripJsonComments(json, {});
stripJsonComments(json, {
whitespace: true
});