-
Notifications
You must be signed in to change notification settings - Fork 37
chore: remove node buffers from runtime code #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"lerna": "3.20.2", | ||
"lerna": "3.22.1", | ||
"packages": [ | ||
"packages/*" | ||
], | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ const files = [] | |
|
||
for await (const file of importer([{ | ||
path: '/foo/bar.txt', | ||
content: Buffer.from(0, 1, 2, 3) | ||
content: new Uint8Array([0, 1, 2, 3]) | ||
}], ipld)) { | ||
files.push(file) | ||
} | ||
|
@@ -74,7 +74,7 @@ for await (const buf of entry.content({ | |
bytes.push(buf) | ||
} | ||
|
||
const content = Buffer.concat(bytes) | ||
const content = new Uint8Array(bytes) | ||
achingbrain marked this conversation as resolved.
Show resolved
Hide resolved
achingbrain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
console.info(content) // 0, 1, 2, 3 | ||
``` | ||
|
@@ -185,7 +185,7 @@ for await (const chunk of entry.content({ | |
} | ||
|
||
// `data` contains the first 5 bytes of the file | ||
const data = Buffer.concat(bufs) | ||
const data = new Uint8Array(bufs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid this is incorrect: [...new Uint8Array([ new Uint8Array([1, 2, 3]), new Uint8Array([4, 5]) ])] // [0, 0] It's probably best to change line 184 to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated it to use
achingbrain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
If `entry` is a directory or hamt shard, passing `offset` and/or `length` to `entry.content()` will limit the number of files returned from the directory. | ||
|
Uh oh!
There was an error while loading. Please reload this page.