File tree Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
+ * .d.ts
2
3
* .log
3
4
coverage /
4
5
node_modules /
Original file line number Diff line number Diff line change 1
- export function whitespace ( node ) {
1
+ /**
2
+ * @param {unknown } thing
3
+ * @returns {boolean }
4
+ */
5
+ export function whitespace ( thing ) {
6
+ /** @type {string } */
2
7
var value =
3
- node && typeof node === 'object' && node . type === 'text'
4
- ? node . value || ''
5
- : node
8
+ // @ts -ignore looks like a node.
9
+ thing && typeof thing === 'object' && thing . type === 'text'
10
+ ? // @ts -ignore looks like a text.
11
+ thing . value || ''
12
+ : thing
6
13
7
14
// HTML whitespace expression.
8
15
// See <https://html.spec.whatwg.org/#space-character>.
Original file line number Diff line number Diff line change 29
29
"sideEffects" : false ,
30
30
"type" : " module" ,
31
31
"main" : " index.js" ,
32
+ "types" : " index.d.ts" ,
32
33
"files" : [
34
+ " index.d.ts" ,
33
35
" index.js"
34
36
],
35
37
"devDependencies" : {
38
+ "@types/tape" : " ^4.0.0" ,
36
39
"c8" : " ^7.0.0" ,
37
40
"prettier" : " ^2.0.0" ,
38
41
"remark-cli" : " ^9.0.0" ,
39
42
"remark-preset-wooorm" : " ^8.0.0" ,
43
+ "rimraf" : " ^3.0.0" ,
40
44
"tape" : " ^5.0.0" ,
45
+ "type-coverage" : " ^2.0.0" ,
46
+ "typescript" : " ^4.0.0" ,
41
47
"xo" : " ^0.39.0"
42
48
},
43
49
"scripts" : {
50
+ "prepack" : " npm run build && npm run format" ,
51
+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
44
52
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
45
53
"test-api" : " node test.js" ,
46
54
"test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
47
- "test" : " npm run format && npm run test-coverage"
55
+ "test" : " npm run build && npm run format && npm run test-coverage"
48
56
},
49
57
"prettier" : {
50
58
"tabWidth" : 2 ,
65
73
"plugins" : [
66
74
" preset-wooorm"
67
75
]
76
+ },
77
+ "typeCoverage" : {
78
+ "atLeast" : 100 ,
79
+ "detail" : true ,
80
+ "strict" : true
68
81
}
69
82
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "include" : [" *.js" ],
3
+ "compilerOptions" : {
4
+ "target" : " ES2020" ,
5
+ "lib" : [" ES2020" ],
6
+ "module" : " ES2020" ,
7
+ "moduleResolution" : " node" ,
8
+ "allowJs" : true ,
9
+ "checkJs" : true ,
10
+ "declaration" : true ,
11
+ "emitDeclarationOnly" : true ,
12
+ "allowSyntheticDefaultImports" : true ,
13
+ "skipLibCheck" : true
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments