File tree Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 11.DS_Store
2+ * .d.ts
23* .log
4+ * .tgz
35.nyc_output /
46coverage /
57node_modules /
Original file line number Diff line number Diff line change @@ -6,17 +6,32 @@ exports.name = name
66
77var id = require ( './regex' )
88
9+ /**
10+ * Checks if the given character code can start an identifier.
11+ *
12+ * @param {number } code
13+ */
914// To do: support astrals.
1015function start ( code ) {
1116 return id . start . test ( String . fromCharCode ( code ) )
1217}
1318
19+ /**
20+ * Checks if the given character code can continue an identifier.
21+ *
22+ * @param {number } code
23+ */
1424// To do: support astrals.
1525function cont ( code ) {
1626 var character = String . fromCharCode ( code )
1727 return id . start . test ( character ) || id . cont . test ( character )
1828}
1929
30+ /**
31+ * Checks if the given string is a valid identifier name.
32+ *
33+ * @param {string } name
34+ */
2035function name ( name ) {
2136 var index = - 1
2237
Original file line number Diff line number Diff line change 2424 ],
2525 "files" : [
2626 " index.js" ,
27- " regex.js"
27+ " regex.js" ,
28+ " *.d.ts"
2829 ],
29- "dependencies" : {},
3030 "devDependencies" : {
31+ "@types/tape" : " ^4.0.0" ,
3132 "@unicode/unicode-13.0.0" : " ^1.0.0" ,
3233 "nyc" : " ^15.0.0" ,
3334 "prettier" : " ^2.0.0" ,
3435 "regenerate" : " ^1.0.0" ,
3536 "remark-cli" : " ^9.0.0" ,
3637 "remark-preset-wooorm" : " ^8.0.0" ,
38+ "rimraf" : " ^3.0.0" ,
3739 "tape" : " ^5.0.0" ,
40+ "type-coverage" : " ^2.0.0" ,
41+ "typescript" : " ^4.0.0" ,
3842 "xo" : " ^0.36.0"
3943 },
4044 "scripts" : {
4145 "generate" : " node build" ,
4246 "format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
4347 "test-api" : " node test" ,
4448 "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"
4652 },
4753 "prettier" : {
4854 "tabWidth" : 2 ,
7379 "plugins" : [
7480 " preset-wooorm"
7581 ]
82+ },
83+ "typeCoverage" : {
84+ "atLeast" : 100 ,
85+ "detail" : true ,
86+ "strict" : true
7687 }
7788}
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