[Implement] Buffer.concat #5
Open
Conversation
|
I think I'm going to implement a test function for utility purposes. function bufferFrom(values: i32[]): Buffer {
let length = values.lengrh;
let buffer = Buffer.allocUnsafe(length);
for (let i = 0; i < length; i++) buffer[i] = u8(unchecked(values[i]));
return buffer;
} This should be relatively safe for testing. |
|
Do you think this can be merged? It looks good to me. |
|
Six months in the making! Time to revive this pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Current problems:No good logging for that extendArrayBufferView(opened issue with as-pect jtenner/as-pect#132 )No good way of comparing things that extendArrayBufferView(opened issue with as-pect jtenner/as-pect#133 )No good way to create a buffer from scratch without a naiveBuffer.from<T>()functionCould create a helper function, but that's a todoThis pull request is not blocked by anything. Current questions:
i32.MAX_VALUE?nullcheck on the array? (in case of uninitialized field problems?)