-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[data-uri-to-buffer] Refactor to return an
ArrayBuffer
instead of a…
… Node.js `Buffer` (#252) Breaking change refactor to return an `ArrayBuffer` instead of a Node.js `Buffer`. This change is being made to make the package platform-agnostic, and work in web browsers or other non-Node.js environments without polyfills. For Node.js users of this package, you can get a Node.js `Buffer` instance from an `ArrayBuffer` like so: ```typescript const uri = 'data:,Hello%2C%20World!'; const parsed = dataUriToBuffer(uri); const buffer = Buffer.from(parsed.buffer); // `buffer` is a Node.js Buffer ```
- Loading branch information
1 parent
aaebfa4
commit 52b458f
Showing
6 changed files
with
175 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
'data-uri-to-buffer': major | ||
--- | ||
|
||
Refactor to return an `ArrayBuffer` instead of a Node.js `Buffer`. | ||
|
||
This change is being made to make the package platform-agnostic, and work in web browsers or other non-Node.js environments without polyfills. | ||
|
||
For Node.js users of this package, you can get a Node.js `Buffer` instance from an `ArrayBuffer` like so: | ||
|
||
```typescript | ||
const uri = 'data:,Hello%2C%20World!'; | ||
const parsed = dataUriToBuffer(uri); | ||
const buffer = Buffer.from(parsed.buffer); | ||
// `buffer` is a Node.js Buffer | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
52b458f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
proxy-agents – ./
proxy-agents.vercel.app
proxy-agents-tootallnate.vercel.app
proxy-agents-git-main-tootallnate.vercel.app
proxy-agents.n8.io