(that, value, encodingOrOffset, length)
| 9812 | } |
| 9813 | |
| 9814 | function from (that, value, encodingOrOffset, length) { |
| 9815 | if (typeof value === 'number') { |
| 9816 | throw new TypeError('"value" argument must not be a number') |
| 9817 | } |
| 9818 | |
| 9819 | if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { |
| 9820 | return fromArrayBuffer(that, value, encodingOrOffset, length) |
| 9821 | } |
| 9822 | |
| 9823 | if (typeof value === 'string') { |
| 9824 | return fromString(that, value, encodingOrOffset) |
| 9825 | } |
| 9826 | |
| 9827 | return fromObject(that, value) |
| 9828 | } |
| 9829 | |
| 9830 | /** |
| 9831 | * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError |
no test coverage detected