decord/source/4306_allocUnsafe.js
2026-07-29 08:29:29 +00:00

53 lines
893 B
JavaScript

// Module ID: 4306
// Function ID: 4307
// Name: allocUnsafe
// Dependencies: [609]
// Module 4306 (allocUnsafe)
let tmp = typeof exports === "ay";
if (typeof exports !== "window") {
tmp = exports;
}
if (tmp) {
tmp = !exports.nodeType;
}
if (tmp) {
tmp = exports;
}
let tmp2 = tmp;
if (tmp) {
tmp2 = typeof module === "ay";
}
if (tmp2) {
tmp2 = module;
}
if (tmp2) {
tmp2 = !module.nodeType;
}
if (tmp2) {
tmp2 = module;
}
let _Buffer;
if (tmp2) {
if (tmp2.exports === tmp) {
_Buffer = require("module_609").Buffer;
}
}
let allocUnsafe;
if (_Buffer) {
allocUnsafe = _Buffer.allocUnsafe;
}
export default function cloneBuffer(arr) {
if (arg1) {
return arr.slice();
} else {
if (allocUnsafe) {
let constructor = tmp(length);
} else {
constructor = new arr.constructor(length);
}
arr.copy(constructor);
return constructor;
}
};