Skip to content
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

buffer: add missing ARG_TYPE(ArrayBuffer) for isUtf8 #52477

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

pluris
Copy link
Contributor

@pluris pluris commented Apr 11, 2024

Added due to inconsistencies between code and documentation.

node/doc/api/buffer.md

Lines 5200 to 5209 in 21211a3

### `buffer.isUtf8(input)`
<!-- YAML
added:
- v19.4.0
- v18.14.0
-->
* input {Buffer | ArrayBuffer | TypedArray} The input to validate.
* Returns: {boolean}

Reference was made to isAscii in the same API format.

node/doc/api/buffer.md

Lines 5184 to 5198 in 21211a3

### `buffer.isAscii(input)`
<!-- YAML
added:
- v19.6.0
- v18.15.0
-->
* input {Buffer | ArrayBuffer | TypedArray} The input to validate.
* Returns: {boolean}
This function returns `true` if `input` contains only valid ASCII-encoded data,
including the case in which `input` is empty.
Throws if the `input` is a detached array buffer.

node/lib/buffer.js

Lines 1290 to 1296 in 21211a3

function isAscii(input) {
if (isTypedArray(input) || isAnyArrayBuffer(input)) {
return bindingIsAscii(input);
}
throw new ERR_INVALID_ARG_TYPE('input', ['ArrayBuffer', 'Buffer', 'TypedArray'], input);
}

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels Apr 11, 2024
@deokjinkim deokjinkim added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@deokjinkim deokjinkim added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 12, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3634f9c into nodejs:main Apr 13, 2024
67 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3634f9c

aduh95 pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #52477
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52477
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52477
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants