From bef806df71ce05037aaab3f6577f60bee6c9f858 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 25 Dec 2022 12:15:43 -0500 Subject: [PATCH] doc: update isUtf8 description --- 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`