@@ -787,7 +787,8 @@ Allocates a new `Buffer` using an `array` of octets.
787787const buf = Buffer .from ([0x62 , 0x75 , 0x66 , 0x66 , 0x65 , 0x72 ]);
788788```
789789
790- A ` TypeError ` will be thrown if ` array ` is not an ` Array ` .
790+ A ` TypeError ` will be thrown if ` array ` is not an ` Array ` or other type
791+ appropriate for ` Buffer.from() ` variants.
791792
792793### Class Method: Buffer.from(arrayBuffer[ , byteOffset[ , length]] )
793794<!-- YAML
@@ -836,7 +837,7 @@ console.log(buf.length);
836837```
837838
838839A ` TypeError ` will be thrown if ` arrayBuffer ` is not an [ ` ArrayBuffer ` ] or a
839- [ ` SharedArrayBuffer ` ] .
840+ [ ` SharedArrayBuffer ` ] or other type appropriate for ` Buffer.from() ` variants .
840841
841842### Class Method: Buffer.from(buffer)
842843<!-- YAML
@@ -860,7 +861,8 @@ console.log(buf2.toString());
860861// Prints: buffer
861862```
862863
863- A ` TypeError ` will be thrown if ` buffer ` is not a ` Buffer ` .
864+ A ` TypeError ` will be thrown if ` buffer ` is not a ` Buffer ` or other type
865+ appropriate for ` Buffer.from() ` variants.
864866
865867### Class Method: Buffer.from(object[ , offsetOrEncoding[ , length]] )
866868<!-- YAML
@@ -896,6 +898,9 @@ const buf = Buffer.from(new Foo(), 'utf8');
896898// Prints: <Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74>
897899```
898900
901+ A ` TypeError ` will be thrown if ` object ` has not mentioned methods or is not of
902+ other type appropriate for ` Buffer.from() ` variants.
903+
899904### Class Method: Buffer.from(string[ , encoding] )
900905<!-- YAML
901906added: v5.10.0
@@ -919,7 +924,8 @@ console.log(buf1.toString('ascii'));
919924// Prints: this is a tC)st
920925```
921926
922- A ` TypeError ` will be thrown if ` string ` is not a string.
927+ A ` TypeError ` will be thrown if ` string ` is not a string or other type
928+ appropriate for ` Buffer.from() ` variants.
923929
924930### Class Method: Buffer.isBuffer(obj)
925931<!-- YAML
0 commit comments