File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 pull_request :
77 branches : [master, develop]
88
9+ permissions :
10+ contents : read
11+
912concurrency :
1013 group : ${{ github.workflow }}-${{ github.ref }}
1114 cancel-in-progress : true
1720 timeout-minutes : 5
1821 steps :
1922 - uses : actions/checkout@v4
23+ with :
24+ persist-credentials : false
2025 - uses : actions/setup-node@v4
2126 with :
2227 node-version : 22
3338 node-version : [20, 22]
3439 steps :
3540 - uses : actions/checkout@v4
41+ with :
42+ persist-credentials : false
3643 - uses : actions/setup-node@v4
3744 with :
3845 node-version : ${{ matrix.node-version }}
4754 needs : [lint, test]
4855 steps :
4956 - uses : actions/checkout@v4
57+ with :
58+ persist-credentials : false
5059 - uses : actions/setup-node@v4
5160 with :
5261 node-version : 22
Original file line number Diff line number Diff line change 99 "unpkg" : " ./dist/index.global.js" ,
1010 "exports" : {
1111 "." : {
12- "types" : " ./dist/index.d.ts" ,
13- "import" : " ./dist/index.mjs" ,
14- "require" : " ./dist/index.cjs" ,
12+ "import" : {
13+ "types" : " ./dist/index.d.ts" ,
14+ "default" : " ./dist/index.mjs"
15+ },
16+ "require" : {
17+ "types" : " ./dist/index.d.cts" ,
18+ "default" : " ./dist/index.cjs"
19+ },
1520 "default" : " ./dist/index.mjs"
1621 },
1722 "./package.json" : " ./package.json"
2429 },
2530 "scripts" : {
2631 "build" : " tsup" ,
32+ "typecheck" : " tsc --noEmit" ,
2733 "test" : " vitest run" ,
2834 "test:watch" : " vitest" ,
2935 "test:coverage" : " vitest run --coverage" ,
3036 "lint" : " biome check src/" ,
3137 "lint:fix" : " biome check --write src/" ,
3238 "format" : " biome format --write src/" ,
33- "prepublishOnly" : " npm run lint && npm run test && npm run build" ,
39+ "prepublishOnly" : " npm run typecheck && npm run lint && npm run test && npm run build" ,
3440 "clean" : " rm -rf dist coverage"
3541 },
3642 "dependencies" : {},
Original file line number Diff line number Diff line change @@ -26,9 +26,10 @@ class JFormatter {
2626 }
2727
2828 format ( args : unknown [ ] ) : string {
29- const regex = / % s / ;
30- const reducer = ( p : string , c : unknown ) : string => p . replace ( regex , String ( c ) ) ;
31- return args . reduce ( reducer , this . template ) as string ;
29+ let i = 0 ;
30+ return this . template . replace ( / % s / g, ( ) => {
31+ return i < args . length ? String ( args [ i ++ ] ) : "%s" ;
32+ } ) ;
3233 }
3334}
3435
Original file line number Diff line number Diff line change @@ -35,15 +35,4 @@ import {
3535} from "./exceptions" ;
3636import { EidPreconditions } from "./preconditions" ;
3737
38- // Backward compatibility: attach preconditions and exceptions to Eid
39- const preconditions = EidPreconditions ;
40- const exceptions = {
41- EidRuntimeException,
42- EidNullPointerException,
43- EidIllegalArgumentException,
44- EidIllegalStateException,
45- EidIndexOutOfBoundsException,
46- } ;
47-
48- export { preconditions , exceptions } ;
4938export default Eid ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function ensureEid(candidate: string | Eid | null | undefined): Eid {
4343}
4444
4545function isIndexAndSizeIllegal ( index : number , size : number ) : boolean {
46- return index < 0 || index > size ;
46+ return index < 0 || index >= size ;
4747}
4848
4949function isSizeIllegal ( size : number ) : boolean {
You can’t perform that action at this time.
0 commit comments