throw new TypeError('"value" argument must not be a number')
}
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
+ if (value instanceof ArrayBuffer) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
}
if (obj) {
- if ((typeof ArrayBuffer !== 'undefined' &&
- obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
+ if (ArrayBuffer.isView(obj) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(0)
}
if (Buffer.isBuffer(string)) {
return string.length
}
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
- (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
+ if (ArrayBuffer.isView(string) || string instanceof ArrayBuffer) {
return string.byteLength
}
if (typeof string !== 'string') {