mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 21:31:12 +08:00
17 lines
496 B
TypeScript
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
|
|
});
|