diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dcda148..a1675bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,12 @@ jobs: - name: ๐Ÿงช Test run: npm run test + - name: ๐Ÿ’ช Generate Types + run: + npx -p typescript tsc --declaration --emitDeclarationOnly --allowJs + --checkJs --skipLibCheck --downlevelIteration --module nodenext + --moduleResolution nodenext --target es2022 --outDir . index.js + release: name: ๐Ÿš€ Release needs: [test] diff --git a/index.js b/index.js index 0dd856f..50626d7 100644 --- a/index.js +++ b/index.js @@ -44,7 +44,7 @@ async function generateHOTP( digits = DEFAULT_DIGITS, algorithm = DEFAULT_ALGORITHM, charSet = DEFAULT_CHAR_SET, - } = {}, + } = {} ) { const byteCounter = intToBytes(counter) const key = await crypto.subtle.importKey( @@ -52,7 +52,7 @@ async function generateHOTP( secret, { name: 'HMAC', hash: algorithm }, false, - ['sign'], + ['sign'] ) const signature = await crypto.subtle.sign('HMAC', key, byteCounter) const hashBytes = new Uint8Array(signature) @@ -101,7 +101,7 @@ async function verifyHOTP( algorithm = DEFAULT_ALGORITHM, charSet = DEFAULT_CHAR_SET, window = DEFAULT_WINDOW, - } = {}, + } = {} ) { for (let i = counter - window; i <= counter + window; ++i) { if ( diff --git a/package-lock.json b/package-lock.json index 9c19c15..6abe318 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@types/node": "^20.4.5" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@types/node": {