File tree Expand file tree Collapse file tree 5 files changed +77
-2
lines changed Expand file tree Collapse file tree 5 files changed +77
-2
lines changed Original file line number Diff line number Diff line change 1616 " Titus Wormer <[email protected] > (https://wooorm.com)" 1717 ],
1818 "files" : [
19- " index.js"
19+ " index.js" ,
20+ " types/index.d.ts"
2021 ],
22+ "types" : " types/index.d.ts" ,
2123 "dependencies" : {
2224 "is-empty" : " ^1.0.0"
2325 },
2426 "devDependencies" : {
27+ "@types/unist" : " ^2.0.3" ,
2528 "browserify" : " ^16.0.0" ,
2629 "chalk" : " ^2.3.0" ,
30+ "dtslint" : " ^1.0.2" ,
2731 "nyc" : " ^14.0.0" ,
2832 "prettier" : " ^1.0.0" ,
2933 "remark-cli" : " ^6.0.0" ,
4145 "build" : " npm run build-bundle && npm run build-mangle" ,
4246 "test-api" : " node test" ,
4347 "test-coverage" : " nyc --reporter lcov tape test.js" ,
44- "test" : " npm run format && npm run build && npm run test-coverage"
48+ "test" : " npm run format && npm run build && npm run test-coverage" ,
49+ "dtslint" : " dtslint types"
4550 },
4651 "prettier" : {
4752 "tabWidth" : 2 ,
Original file line number Diff line number Diff line change 1+ // TypeScript Version: 3.0
2+ import { Node } from 'unist' ;
3+
4+ export = inpect ;
5+
6+ /*
7+ * Unist utility to inspect the details of a Unist Node
8+ *
9+ * @param node Node to inspect
10+ */
11+ declare function inpect ( node : Node ) : string ;
12+
13+ declare namespace inpect {
14+ /**
15+ * Inspect the given Node and include colors from the results
16+ *
17+ * @param node Node to inspect
18+ */
19+ function color ( node : Node ) : string ;
20+
21+ /**
22+ * Inspect the given Node and exclude colors from the results
23+ *
24+ * @param node Node to inspect
25+ */
26+ function noColor ( node : Node ) : string ;
27+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "lib" : [" es2015" ],
4+ "strict" : true ,
5+ "baseUrl" : " ." ,
6+ "paths" : {
7+ "unist-util-inspect" : [" index.d.ts" ]
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " dtslint/dtslint.json"
3+ }
Original file line number Diff line number Diff line change 1+ import * as inspect from 'unist-util-inspect' ;
2+
3+ const node = {
4+ type : 'node' ,
5+ data : {
6+ string : 'string' ,
7+ number : 1 ,
8+ object : {
9+ key : 'value'
10+ } ,
11+ array : [ ] ,
12+ boolean : true ,
13+ null : null
14+ } ,
15+ position : {
16+ start : {
17+ line : 1 ,
18+ column : 1 ,
19+ offset : 0
20+ } ,
21+ end : {
22+ line : 1 ,
23+ column : 4 ,
24+ offset : 0
25+ } ,
26+ indent : [ 1 ]
27+ }
28+ } ;
29+
30+ const result : string = inspect ( node ) ;
You can’t perform that action at this time.
0 commit comments