@pixi/utils
Version:
Collection of utilities used by PixiJS
27 lines (23 loc) • 667 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4) {
if (array instanceof Float32Array) {
return "Float32Array";
} else if (array instanceof Uint32Array) {
return "Uint32Array";
}
return "Int32Array";
} else if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array) {
return "Uint16Array";
}
} else if (array.BYTES_PER_ELEMENT === 1) {
if (array instanceof Uint8Array) {
return "Uint8Array";
}
}
return null;
}
exports.getBufferType = getBufferType;
//# sourceMappingURL=getBufferType.js.map