File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
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 @@ -4,7 +4,9 @@ import {bail} from 'bail'
4
4
import concat from 'concat-stream'
5
5
import unified from 'unified'
6
6
import parse from 'rehype-parse'
7
+ // @ts -ignore
7
8
import select from 'hast-util-select'
9
+ // @ts -ignore
8
10
import toString from 'hast-util-to-string'
9
11
import { svgTagNames } from './index.js'
10
12
@@ -22,13 +24,20 @@ while (++index < urls.length) {
22
24
https . get ( urls [ index ] , onconnection )
23
25
}
24
26
27
+ /**
28
+ * @param {import('http').IncomingMessage } response
29
+ */
25
30
function onconnection ( response ) {
26
31
response . pipe ( concat ( onconcat ) ) . on ( 'error' , bail )
27
32
}
28
33
34
+ /**
35
+ * @param {Buffer } buf
36
+ */
29
37
function onconcat ( buf ) {
30
38
var nodes = select . selectAll ( '.element-name' , proc . parse ( buf ) )
31
39
var index = - 1
40
+ /** @type {string } */
32
41
var value
33
42
34
43
while ( ++ index < nodes . length ) {
Original file line number Diff line number Diff line change 24
24
"sideEffects" : false ,
25
25
"type" : " module" ,
26
26
"main" : " index.js" ,
27
+ "types" : " index.d.ts" ,
27
28
"files" : [
29
+ " index.d.ts" ,
28
30
" index.js"
29
31
],
30
32
"devDependencies" : {
33
+ "@types/concat-stream" : " ^1.0.0" ,
34
+ "@types/node" : " ^14.0.0" ,
35
+ "@types/tape" : " ^4.0.0" ,
31
36
"bail" : " ^2.0.0" ,
32
37
"c8" : " ^7.0.0" ,
33
38
"concat-stream" : " ^2.0.0" ,
37
42
"rehype-parse" : " ^7.0.0" ,
38
43
"remark-cli" : " ^9.0.0" ,
39
44
"remark-preset-wooorm" : " ^8.0.0" ,
45
+ "rimraf" : " ^3.0.0" ,
40
46
"tape" : " ^5.0.0" ,
47
+ "type-coverage" : " ^2.0.0" ,
48
+ "typescript" : " ^4.0.0" ,
41
49
"unified" : " ^9.0.0" ,
42
50
"xo" : " ^0.38.0"
43
51
},
44
52
"scripts" : {
53
+ "prepack" : " npm run build && npm run format" ,
54
+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
45
55
"generate" : " node build" ,
46
56
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
47
57
"test-api" : " node test.js" ,
48
58
"test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
49
- "test" : " npm run format && npm run test-coverage"
59
+ "test" : " npm run build && npm run format && npm run test-coverage"
50
60
},
51
61
"prettier" : {
52
62
"tabWidth" : 2 ,
68
78
"plugins" : [
69
79
" preset-wooorm"
70
80
]
81
+ },
82
+ "typeCoverage" : {
83
+ "atLeast" : 100 ,
84
+ "detail" : true ,
85
+ "strict" : true
71
86
}
72
87
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "files" : [" index.js" ],
3
+ "include" : [" *.js" ],
4
+ "compilerOptions" : {
5
+ "target" : " ES2020" ,
6
+ "lib" : [" ES2020" ],
7
+ "module" : " ES2020" ,
8
+ "moduleResolution" : " node" ,
9
+ "allowJs" : true ,
10
+ "checkJs" : true ,
11
+ "declaration" : true ,
12
+ "emitDeclarationOnly" : true ,
13
+ "allowSyntheticDefaultImports" : true ,
14
+ "skipLibCheck" : true
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments