in modules/jupyter-widget/src/lib/utils/deserialize-matrix.js [6:33]
function dtypeToTypedArray(dtype) {
// Supports converting a numpy-typed array to a JavaScript-typed array
// based on a string value dtype and a DataView `data`
switch (dtype) {
case 'int8':
return Int8Array;
case 'uint8':
return Uint8Array;
case 'int16':
return Int16Array;
case 'uint16':
return Uint16Array;
case 'float32':
return Float32Array;
case 'float64':
return Float64Array;
case 'int32':
return Int32Array;
case 'uint32':
return Uint32Array;
case 'int64':
return BigInt64Array; // eslint-disable-line no-undef
case 'uint64':
return BigUint64Array; // eslint-disable-line no-undef
default:
throw new Error(`Unrecognized dtype ${dtype}`);
}
}