Skip to content

Commit

Permalink
ci: 🎡 update build configuration
Browse files Browse the repository at this point in the history
unbuilt后执行tsc

✅ Closes: #1
  • Loading branch information
RSoraM committed Dec 11, 2024
1 parent 8069d02 commit 02fa530
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
failOnWarn: false,
entries: [
'src/index',
],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.mjs",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
Expand All @@ -57,6 +57,7 @@
],
"scripts": {
"build": "unbuild",
"postbuild": "tsc",
"dev": "unbuild --stub",
"lint": "eslint .",
"prepublishOnly": "nr build",
Expand Down
5 changes: 3 additions & 2 deletions src/hash/keccak1600.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { KitError, rotateL64 } from '../core/utils'

// * Constants

export const PERMUTATION: KeccakConfig = {
export const PERMUTATION: KeccakConfig = Object.freeze({
b: 1600,
bByte: 200,
w: 64,
wByte: 8,
l: 6,
nr: 24,
}
})

/**
* FIPS.202 3.2.2
Expand Down Expand Up @@ -222,6 +222,7 @@ export function Keccak_p_1600(nr?: number) {
* @param {Uint8Array} S - 状态
*/
return (S: Uint8Array) => {
nr = nr || PERMUTATION.nr
if (S.byteLength !== PERMUTATION.bByte) {
throw new KitError('Invalid state size')
}
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
],
"strict": true,
"strictNullChecks": true,
"outDir": "dist",
"esModuleInterop": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true
}
},
"include": ["src/index.ts"]
}

0 comments on commit 02fa530

Please sign in to comment.