Skip to content

fixed deprecated warning for the Buffer.slice method#47

Merged
MauriceButler merged 1 commit intoMauriceButler:masterfrom
victorfreitas:master
Sep 4, 2023
Merged

fixed deprecated warning for the Buffer.slice method#47
MauriceButler merged 1 commit intoMauriceButler:masterfrom
victorfreitas:master

Conversation

@victorfreitas
Copy link
Copy Markdown
Contributor

@victorfreitas victorfreitas commented Sep 2, 2023

Moved to Buffer.subarray method of the Buffer API instead of the deprecated (since v16.x) method Buffer.slice.

// Deprecated "slice" method: @since v0.3.0
const buffer = Buffer.from('xxxxx', 'hex');
const bufferPart = buffer.slice(0, 16);
// Recommended "subarray" method: @since v3.0.0
const buffer = Buffer.from('xxxxx', 'hex');
const bufferPart = buffer.subarray(0, 16);

@MauriceButler MauriceButler merged commit dcf9c76 into MauriceButler:master Sep 4, 2023
@MauriceButler
Copy link
Copy Markdown
Owner

Thanks, released in version v6.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants