Skip to content

Commit

Permalink
use string.split('') over spread
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Feb 22, 2024
1 parent fcf639d commit 4cd75a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dpop.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const generateKeyPair: GenerateKeyPair = async () => {
};

export const stringToBytes = (string: string): Uint8Array => {
return new Uint8Array([...string].map((c) => c.charCodeAt(0)));
// webpack transforms [..."string"] to [].concat("string")
// eslint-disable-next-line unicorn/prefer-spread
return new Uint8Array(string.split("").map((c) => c.charCodeAt(0)));
};

export const bytesToString = (bytes: Uint8Array): string => {
Expand Down

0 comments on commit 4cd75a5

Please sign in to comment.