meta.type = 'buffer'
} else if (Array.isArray(value)) {
meta.type = 'array'
- } else if (isTypedArray(value.buffer)) {
+ } else if (isTypedArray(value)) {
meta.type = 'typed-array'
} else if (value instanceof Error) {
meta.type = 'error'
val instanceof Uint16Array ||
val instanceof Uint32Array ||
val instanceof Float32Array ||
- val instanceof Float64Array)
+ val instanceof Float64Array) ||
+ (Object.prototype.toString.call(val).substr(-6, 5) === 'Array')
)
}
type: 'buffer',
value: Array.prototype.slice.call(value, 0)
}
- } else if (isTypedArray(value.buffer)) {
+ } else if (isTypedArray(value)) {
return {
type: 'typed-array',
value: Array.prototype.slice.call(value)