Skip to content

Commit

Permalink
Merge pull-request #125
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkmin committed Oct 5, 2023
2 parents 4069b54 + a96c30f commit d5876c4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/webauthn-stamper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
},
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"buffer": "^6.0.3"
}
}
1 change: 1 addition & 0 deletions packages/webauthn-stamper/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference lib="dom" />
import { get as webauthnCredentialGet } from "./webauthn-json";
import { buffer as Buffer } from "./universal";

// Header name for a webauthn stamp
const stampHeaderName = "X-Stamp-Webauthn";
Expand Down
9 changes: 9 additions & 0 deletions packages/webauthn-stamper/src/universal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let buffer: typeof globalThis.Buffer;

if (typeof globalThis?.Buffer !== "undefined") {
buffer = globalThis.Buffer;
} else {
buffer = require("buffer").Buffer;
}

export { buffer };
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

0 comments on commit d5876c4

Please sign in to comment.