From 5ba17175022f0d790029ac3fa42884110af85b7d Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 1 Jan 2023 11:40:18 -0500 Subject: [PATCH] doc: update isUtf8 description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45973 Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso --- doc/api/buffer.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 3ed750fce8a1cc..c690cee485e1a2 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -5137,9 +5137,12 @@ added: REPLACEME --> * input {Buffer | ArrayBuffer | TypedArray} The input to validate. -* Returns: {boolean} Returns `true` if and only if the input is valid UTF-8. +* Returns: {boolean} + +This function returns `true` if `input` contains only valid UTF-8-encoded data, +including the case in which `input` is empty. -This function is used to check if input contains UTF-8 code points (characters). +Throws if the `input` is a detached array buffer. ### `buffer.INSPECT_MAX_BYTES`