* The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation wo
(arg, encodingOrOffset, length)
| 96 | */ |
| 97 | |
| 98 | function Buffer (arg, encodingOrOffset, length) { |
| 99 | // Common case. |
| 100 | if (typeof arg === 'number') { |
| 101 | if (typeof encodingOrOffset === 'string') { |
| 102 | throw new TypeError( |
| 103 | 'The "string" argument must be of type string. Received type number' |
| 104 | ) |
| 105 | } |
| 106 | return allocUnsafe(arg) |
| 107 | } |
| 108 | return from(arg, encodingOrOffset, length) |
| 109 | } |
| 110 | |
| 111 | Buffer.poolSize = 8192 // not used by this implementation |
| 112 |
no test coverage detected
searching dependent graphs…