(value, encodingOrOffset, length)
| 241 | Buffer.poolSize = 8192 // not used by this implementation |
| 242 | |
| 243 | function from (value, encodingOrOffset, length) { |
| 244 | if (typeof value === 'number') { |
| 245 | throw new TypeError('"value" argument must not be a number') |
| 246 | } |
| 247 | |
| 248 | if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) { |
| 249 | return fromArrayBuffer(value, encodingOrOffset, length) |
| 250 | } |
| 251 | |
| 252 | if (typeof value === 'string') { |
| 253 | return fromString(value, encodingOrOffset) |
| 254 | } |
| 255 | |
| 256 | return fromObject(value) |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError |
no test coverage detected
searching dependent graphs…