decord/source/4238_allocUnsafe.js

46 lines
895 B
JavaScript
Raw Normal View History

2026-07-21 06:55:02 +00:00
// Module ID: 4238
2026-07-21 22:01:30 +00:00
// Function ID: 37288
2026-07-20 16:05:17 +00:00
// Name: allocUnsafe
// Dependencies: []
2026-07-21 06:55:02 +00:00
// Module 4238 (allocUnsafe)
2026-07-20 16:05:17 +00:00
let tmp2 = tmp;
if ("object" === typeof exports && exports && !exports.nodeType && exports) {
tmp2 = "object" === typeof module;
}
if (tmp2) {
tmp2 = module;
}
if (tmp2) {
tmp2 = !module.nodeType;
}
if (tmp2) {
tmp2 = module;
}
let _Buffer;
if (tmp2) {
if (tmp2.exports === tmp) {
_Buffer = require(dependencyMap[0]).Buffer;
}
}
let allocUnsafe;
if (_Buffer) {
allocUnsafe = _Buffer.allocUnsafe;
}
export default function cloneBuffer(arr) {
if (arg1) {
return arr.slice();
} else {
if (allocUnsafe) {
let constructor = allocUnsafe(length);
} else {
constructor = arr.constructor;
const prototype = constructor.prototype;
constructor = new constructor(length);
}
arr.copy(constructor);
return constructor;
}
};