File tree 3 files changed +32
-17
lines changed
3 files changed +32
-17
lines changed Original file line number Diff line number Diff line change 4
4
import fs from 'node:fs'
5
5
import path from 'node:path'
6
6
import regenerate from 'regenerate'
7
- import idStart from '@unicode/unicode-15.0.0/Binary_Property/ID_Start/code-points.js'
8
- import idCont from '@unicode/unicode-15.0.0/Binary_Property/ID_Continue/code-points.js'
7
+ // @ts -expect-error untyped.
8
+ import idStart_ from '@unicode/unicode-15.0.0/Binary_Property/ID_Start/code-points.js'
9
+ /** @type {Array<number> } */
10
+ // @ts -expect-error untyped.
11
+ import idCont_ from '@unicode/unicode-15.0.0/Binary_Property/ID_Continue/code-points.js'
12
+
13
+ const idStart = /** @type {Array<number> } */ ( idStart_ )
14
+ const idCont = /** @type {Array<number> } */ ( idCont_ )
9
15
10
16
const start = [ 36 /* `$` */ , 95 /* `_` */ ] . concat ( idStart . filter ( ( d ) => bmp ( d ) ) )
11
17
const cont = [ 0x20_0c , 0x20_0d ] . concat ( idCont . filter ( ( d ) => bmp ( d ) ) )
@@ -23,6 +29,14 @@ fs.writeFileSync(
23
29
] . join ( '\n' )
24
30
)
25
31
32
+ /**
33
+ * Check if `code` is BMP.
34
+ *
35
+ * @param {number } code
36
+ * Character code.
37
+ * @returns {boolean }
38
+ * Whether `code` is BMP.
39
+ */
26
40
function bmp ( code ) {
27
41
return code <= 0xff_ff /* BMP */
28
42
}
Original file line number Diff line number Diff line change 33
33
" regex.js"
34
34
],
35
35
"devDependencies" : {
36
+ "@types/regenerate" : " ^1.0.0" ,
36
37
"@types/tape" : " ^4.0.0" ,
37
38
"@unicode/unicode-15.0.0" : " ^1.0.0" ,
38
39
"c8" : " ^7.6.0" ,
39
- "nyc" : " ^15.0.0" ,
40
40
"prettier" : " ^2.0.0" ,
41
41
"regenerate" : " ^1.0.0" ,
42
42
"remark-cli" : " ^11.0.0" ,
43
43
"remark-preset-wooorm" : " ^9.0.0" ,
44
- "rimraf" : " ^3.0.0" ,
45
44
"tape" : " ^5.0.0" ,
46
45
"type-coverage" : " ^2.0.0" ,
47
46
"typescript" : " ^4.0.0" ,
48
47
"xo" : " ^0.53.0"
49
48
},
50
49
"scripts" : {
51
- "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
52
- "generate" : " node build" ,
50
+ "prepack" : " npm run build && npm run format" ,
51
+ "generate" : " node --conditions development build.js" ,
52
+ "build" : " tsc --build --clean && tsc --build && type-coverage" ,
53
53
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
54
- "test-api" : " node test.js" ,
55
- "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
56
- "test" : " npm run generate && npm run build && npm run format && npm run test-coverage" ,
57
- "prepack" : " npm run build && npm run format"
54
+ "test-api" : " node --conditions development test.js" ,
55
+ "test-coverage" : " c8 --check-coverage --100 --reporter lcov npm run test-api" ,
56
+ "test" : " npm run generate && npm run build && npm run format && npm run test-coverage"
58
57
},
59
58
"prettier" : {
60
59
"tabWidth" : 2 ,
Original file line number Diff line number Diff line change 1
1
{
2
- "files" : [" index.js" ],
2
+ "include" : [" **/**.js" ],
3
+ "exclude" : [" coverage/" , " node_modules/" ],
3
4
"compilerOptions" : {
4
- "target" : " ES2020" ,
5
- "lib" : [" ES2020" ],
6
- "module" : " ES2020" ,
7
- "moduleResolution" : " node" ,
8
- "allowJs" : true ,
9
5
"checkJs" : true ,
10
6
"declaration" : true ,
11
7
"emitDeclarationOnly" : true ,
8
+ "exactOptionalPropertyTypes" : true ,
9
+ "forceConsistentCasingInFileNames" : true ,
10
+ "lib" : [" es2020" ],
11
+ "module" : " node16" ,
12
+ "newLine" : " lf" ,
12
13
"skipLibCheck" : true ,
13
- "strict" : true
14
+ "strict" : true ,
15
+ "target" : " es2020"
14
16
}
15
17
}
You can’t perform that action at this time.
0 commit comments