mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Add Types for comment-json
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import * as commentJson from 'comment-json';
|
||||
|
||||
const result = commentJson.parse(`
|
||||
/**
|
||||
block comment at the top
|
||||
*/
|
||||
// comment at the top
|
||||
{
|
||||
// comment for a
|
||||
// comment line 2 for a
|
||||
/* block comment */
|
||||
"a": 1 // comment at right
|
||||
}
|
||||
// comment at the bottom
|
||||
`);
|
||||
const str = commentJson.stringify(result);
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for comment-json 1.1
|
||||
// Project: https://github.com/kaelzhang/node-comment-json
|
||||
// Definitions by: Jason Dent <https://github.com/Jason3S>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export type Reviver = (k: number | string, v: any) => any;
|
||||
export function parse(json: string, reviver?: Reviver, removes_comments?: boolean): any;
|
||||
export function stringify(value: any, replacer?: any, space?: string | number): string;
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"comment-json-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user