@pixi/utils
Version:
Collection of utilities used by PixiJS
14 lines (13 loc) • 507 B
JavaScript
;
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4)
return array instanceof Float32Array ? "Float32Array" : array instanceof Uint32Array ? "Uint32Array" : "Int32Array";
if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array)
return "Uint16Array";
} else if (array.BYTES_PER_ELEMENT === 1 && array instanceof Uint8Array)
return "Uint8Array";
return null;
}
exports.getBufferType = getBufferType;
//# sourceMappingURL=getBufferType.js.map