mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-01 10:54:34 +08:00
12 lines
249 B
TypeScript
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
|
|
});
|