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 @@ -3,7 +3,9 @@ import https from 'https'
3
3
import concat from 'concat-stream'
4
4
import unified from 'unified'
5
5
import html from 'rehype-parse'
6
+ // @ts -ignore
6
7
import q from 'hast-util-select'
8
+ // @ts -ignore
7
9
import toString from 'hast-util-to-string'
8
10
import { bail } from 'bail'
9
11
import { htmlVoidElements } from './index.js'
@@ -12,14 +14,21 @@ var proc = unified().use(html)
12
14
13
15
https . get ( 'https://html.spec.whatwg.org/multipage/syntax.html' , onconnection )
14
16
17
+ /**
18
+ * @param {import('http').IncomingMessage } response
19
+ */
15
20
function onconnection ( response ) {
16
21
response . pipe ( concat ( onconcat ) ) . on ( 'error' , bail )
17
22
}
18
23
24
+ /**
25
+ * @param {Buffer } buf
26
+ */
19
27
function onconcat ( buf ) {
20
28
var dl = q . select ( '#elements-2 ~ dl dd' , proc . parse ( buf ) )
21
29
var nodes = q . selectAll ( 'code' , dl )
22
30
var index = - 1
31
+ /** @type {string } */
23
32
var value
24
33
25
34
while ( ++ index < nodes . length ) {
Original file line number Diff line number Diff line change 26
26
"sideEffects" : false ,
27
27
"type" : " module" ,
28
28
"main" : " index.js" ,
29
+ "types" : " index.d.ts" ,
29
30
"files" : [
31
+ " index.d.ts" ,
30
32
" index.js"
31
33
],
32
34
"devDependencies" : {
35
+ "@types/concat-stream" : " ^1.0.0" ,
36
+ "@types/node" : " ^14.0.0" ,
37
+ "@types/tape" : " ^4.0.0" ,
33
38
"bail" : " ^2.0.0" ,
34
39
"c8" : " ^7.0.0" ,
35
40
"concat-stream" : " ^2.0.0" ,
39
44
"rehype-parse" : " ^7.0.0" ,
40
45
"remark-cli" : " ^9.0.0" ,
41
46
"remark-preset-wooorm" : " ^8.0.0" ,
47
+ "rimraf" : " ^3.0.0" ,
42
48
"tape" : " ^5.0.0" ,
49
+ "type-coverage" : " ^2.0.0" ,
50
+ "typescript" : " ^4.0.0" ,
43
51
"unified" : " ^9.0.0" ,
44
52
"xo" : " ^0.38.0"
45
53
},
46
54
"scripts" : {
55
+ "prepack" : " npm run build && npm run format" ,
56
+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
47
57
"generate" : " node build" ,
48
58
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
49
59
"test-api" : " node test.js" ,
50
60
"test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
51
- "test" : " npm run format && npm run test-coverage"
61
+ "test" : " npm run build && npm run format && npm run test-coverage"
52
62
},
53
63
"prettier" : {
54
64
"tabWidth" : 2 ,
70
80
"plugins" : [
71
81
" preset-wooorm"
72
82
]
83
+ },
84
+ "typeCoverage" : {
85
+ "atLeast" : 100 ,
86
+ "detail" : true ,
87
+ "strict" : true
73
88
}
74
89
}
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