File tree 4 files changed +45
-3
lines changed 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
+ * .d.ts
2
3
* .log
4
+ * .tgz
3
5
.nyc_output /
4
6
coverage /
5
7
node_modules /
Original file line number Diff line number Diff line change @@ -6,17 +6,32 @@ exports.name = name
6
6
7
7
var id = require ( './regex' )
8
8
9
+ /**
10
+ * Checks if the given character code can start an identifier.
11
+ *
12
+ * @param {number } code
13
+ */
9
14
// To do: support astrals.
10
15
function start ( code ) {
11
16
return id . start . test ( String . fromCharCode ( code ) )
12
17
}
13
18
19
+ /**
20
+ * Checks if the given character code can continue an identifier.
21
+ *
22
+ * @param {number } code
23
+ */
14
24
// To do: support astrals.
15
25
function cont ( code ) {
16
26
var character = String . fromCharCode ( code )
17
27
return id . start . test ( character ) || id . cont . test ( character )
18
28
}
19
29
30
+ /**
31
+ * Checks if the given string is a valid identifier name.
32
+ *
33
+ * @param {string } name
34
+ */
20
35
function name ( name ) {
21
36
var index = - 1
22
37
Original file line number Diff line number Diff line change 24
24
],
25
25
"files" : [
26
26
" index.js" ,
27
- " regex.js"
27
+ " regex.js" ,
28
+ " *.d.ts"
28
29
],
29
- "dependencies" : {},
30
30
"devDependencies" : {
31
+ "@types/tape" : " ^4.0.0" ,
31
32
"@unicode/unicode-13.0.0" : " ^1.0.0" ,
32
33
"nyc" : " ^15.0.0" ,
33
34
"prettier" : " ^2.0.0" ,
34
35
"regenerate" : " ^1.0.0" ,
35
36
"remark-cli" : " ^9.0.0" ,
36
37
"remark-preset-wooorm" : " ^8.0.0" ,
38
+ "rimraf" : " ^3.0.0" ,
37
39
"tape" : " ^5.0.0" ,
40
+ "type-coverage" : " ^2.0.0" ,
41
+ "typescript" : " ^4.0.0" ,
38
42
"xo" : " ^0.36.0"
39
43
},
40
44
"scripts" : {
41
45
"generate" : " node build" ,
42
46
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
43
47
"test-api" : " node test" ,
44
48
"test-coverage" : " nyc --reporter lcov tape test.js" ,
45
- "test" : " npm run generate && npm run format && npm run test-coverage"
49
+ "build" : " rimraf \" *.d.ts\" && tsc && type-coverage" ,
50
+ "test" : " npm run generate && npm run format && npm run test-coverage && npm run build" ,
51
+ "prepack" : " npm run build && npm run format"
46
52
},
47
53
"prettier" : {
48
54
"tabWidth" : 2 ,
73
79
"plugins" : [
74
80
" preset-wooorm"
75
81
]
82
+ },
83
+ "typeCoverage" : {
84
+ "atLeast" : 100 ,
85
+ "detail" : true ,
86
+ "strict" : true
76
87
}
77
88
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "files" : [" index.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
+ "skipLibCheck" : true
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments