Skip to content

Commit e113d16

Browse files
anonrigRafaelGSS
authored andcommitted
doc: update isUtf8 description
PR-URL: #45973 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 54776ff commit e113d16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/api/buffer.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -5137,9 +5137,12 @@ added: REPLACEME
51375137
-->
51385138

51395139
* input {Buffer | ArrayBuffer | TypedArray} The input to validate.
5140-
* Returns: {boolean} Returns `true` if and only if the input is valid UTF-8.
5140+
* Returns: {boolean}
5141+
5142+
This function returns `true` if `input` contains only valid UTF-8-encoded data,
5143+
including the case in which `input` is empty.
51415144

5142-
This function is used to check if input contains UTF-8 code points (characters).
5145+
Throws if the `input` is a detached array buffer.
51435146

51445147
### `buffer.INSPECT_MAX_BYTES`
51455148

0 commit comments

Comments
 (0)