decord/source/4595_allocUnsafe.js

56 lines
932 B
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 4595
// Function ID: 4596
2026-07-20 16:05:17 +00:00
// Name: allocUnsafe
2026-07-29 08:29:29 +00:00
// Dependencies: [609]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 4595 (allocUnsafe)
import _mod609 from "module_609" /* 609 */;
2026-08-04 21:03:28 +00:00
let tmp = typeof exports === "object";
if (typeof exports === "object") {
2026-07-29 08:29:29 +00:00
tmp = exports;
}
if (tmp) {
tmp = !exports.nodeType;
}
if (tmp) {
tmp = exports;
}
2026-07-20 16:05:17 +00:00
let tmp2 = tmp;
2026-07-23 10:11:24 +00:00
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp2 = typeof module === "object";
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
tmp2 = module;
}
if (tmp2) {
tmp2 = !module.nodeType;
}
if (tmp2) {
tmp2 = module;
}
let _Buffer;
if (tmp2) {
if (tmp2.exports === tmp) {
2026-08-24 06:08:38 +00:00
_Buffer = _mod609.Buffer;
2026-07-20 16:05:17 +00:00
}
}
let allocUnsafe;
if (_Buffer) {
allocUnsafe = _Buffer.allocUnsafe;
}
export default function cloneBuffer(arr) {
if (arg1) {
return arr.slice();
} else {
if (allocUnsafe) {
2026-07-29 08:29:29 +00:00
let constructor = tmp(length);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
constructor = new arr.constructor(length);
2026-07-20 16:05:17 +00:00
}
arr.copy(constructor);
return constructor;
}
};