Skip to content

Commit

Permalink
Update dependencies and move from yarn to npm
Browse files Browse the repository at this point in the history
Notably:

* We can remove minipass-fetch in favor of Node.js's built-in fetch().
* We can remove abab in favor of Node.js's built-in atob().
* We can remove jest in favor of Node.js's built-in test runner, plus c8.
  • Loading branch information
domenic committed Nov 11, 2023
1 parent e276857 commit 9ec9439
Show file tree
Hide file tree
Showing 9 changed files with 1,578 additions and 2,731 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn lint
- run: yarn test
- run: npm ci
- run: npm run lint
- run: npm test
8 changes: 5 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use strict";
const { atob } = require("abab");

exports.stripLeadingAndTrailingASCIIWhitespace = string => {
return string.replace(/^[ \t\n\f\r]+/u, "").replace(/[ \t\n\f\r]+$/u, "");
Expand All @@ -10,9 +9,12 @@ exports.isomorphicDecode = input => {
};

exports.forgivingBase64Decode = data => {
const asString = atob(data);
if (asString === null) {
let asString;
try {
asString = atob(data);
} catch {
return null;
}

return Uint8Array.from(asString, c => c.codePointAt(0));
};
Loading

0 comments on commit 9ec9439

Please sign in to comment.