Skip to content

Commit

Permalink
chore: format and update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Feb 14, 2025
1 parent 5667722 commit 0690464
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ async function generateHOTP(
digits = DEFAULT_DIGITS,
algorithm = DEFAULT_ALGORITHM,
charSet = DEFAULT_CHAR_SET,
} = {},
} = {}
) {
const byteCounter = intToBytes(counter)
const key = await crypto.subtle.importKey(
'raw',
secret,
{ name: 'HMAC', hash: algorithm },
false,
['sign'],
['sign']
)
const signature = await crypto.subtle.sign('HMAC', key, byteCounter)
const hashBytes = new Uint8Array(signature)
Expand Down Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0690464

Please sign in to comment.