From c3d573d743427f74d378d90768cfe5d17ad6c755 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sat, 30 Mar 2019 20:45:19 +0200 Subject: [PATCH] doc: fix error notes in `Buffer.from()` variants Make notes about `TypeError` conditions in `Buffer.from()` variants more accurate. PR-URL: https://github.com/nodejs/node/pull/27030 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Signed-off-by: Beth Griggs --- doc/api/buffer.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 969668dd7a977a..afeef8b3c203ae 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -787,7 +787,8 @@ Allocates a new `Buffer` using an `array` of octets. const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); ``` -A `TypeError` will be thrown if `array` is not an `Array`. +A `TypeError` will be thrown if `array` is not an `Array` or other type +appropriate for `Buffer.from()` variants. ### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])