From 2307a74990965b9d95979f4009713654e7ca55a1 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 93b55bf4424401..2d34d57c6efdd1 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -5133,9 +5133,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`