Skip to content

Buffer.from() ignores byteOffset and length parametersΒ #22387

@njor

Description

@njor

According to the documentation, the Buffer.from() function should accept byteOffset and length parameters, but those are actually ignored:

Buffer.from( "hello world" )
<Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
Buffer.from( "hello world", 2, 3 )
<Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>

Expected output:

Buffer.from( "hello world", 2, 3 )
<Buffer 6c 6c 6f>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.invalidIssues and PRs that are invalid.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions