File tree Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,14 @@ function createBoundary(size: number): string {
10
10
let res = ""
11
11
12
12
while ( size -- ) {
13
- res += alphabet [ Math . floor ( Math . random ( ) * alphabet . length ) ]
13
+ // I use bitwise `<<` here for slightly more performant string fill.
14
+ // It will basically do same thing as `Math.truc()`,
15
+ // except it only support signed 32-bit integers.
16
+ // Because the result of this operation will always be
17
+ // a number in range `0` and `alphabet.length - 1` (inclusive),
18
+ // so we don't need `Math.floor()` too.
19
+ /* eslint no-bitwise: ["error", {"allow": ["<<"]}] */
20
+ res += alphabet [ ( Math . random ( ) * alphabet . length ) << 0 ]
14
21
}
15
22
16
23
return res
Original file line number Diff line number Diff line change 27
27
"ci" : " c8 npm test && c8 report --reporter=json" ,
28
28
"build:esm" : " ttsc --project tsconfig.esm.json" ,
29
29
"build:cjs" : " ttsc --project tsconfig.cjs.json" ,
30
- "build" : " npm run build:esm && npm run build:cjs" ,
30
+ "build:types" : " ttsc --project tsconfig.d.ts.json" ,
31
+ "build" : " npm run build:esm && npm run build:cjs && npm run build:types" ,
31
32
"test" : " ava --fail-fast" ,
32
33
"cleanup" : " npx rimraf @type \" lib/**/*.js\" " ,
33
34
"prepare" : " npm run cleanup && npm run build" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ./tsconfig.esm.json" ,
3
+ "compilerOptions" : {
4
+ "declaration" : true ,
5
+ "declarationDir" : " ./@type" ,
6
+ "removeComments" : false ,
7
+ "emitDeclarationOnly" : true
8
+ }
9
+ }
Original file line number Diff line number Diff line change 2
2
"extends" : " ./tsconfig.json" ,
3
3
"compilerOptions" : {
4
4
"module" : " es2020" ,
5
- "outDir" : " lib/esm" ,
6
- "declaration" : true ,
7
- "declarationDir" : " ./@type" ,
5
+ "outDir" : " lib/esm"
8
6
}
9
7
}
Original file line number Diff line number Diff line change 21
21
"forceConsistentCasingInFileNames" : true ,
22
22
"allowSyntheticDefaultImports" : true ,
23
23
"experimentalDecorators" : true ,
24
+ "removeComments" : true ,
24
25
"plugins" : [
25
26
{
26
27
"transform" : " @zoltu/typescript-transformer-append-js-extension/output/index.js" ,
27
28
"after" : true
28
29
}
29
30
]
30
31
}
31
- }
32
+ }
You can’t perform that action at this time.
0 commit comments