decord/source/1408_isBuffer.js

24 lines
414 B
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1408
// Function ID: 1409
// Name: isBuffer
// Dependencies: []
// Module 1408 (isBuffer)
2026-08-04 21:03:28 +00:00
export default function isBuffer(obj) {
let tmp = obj;
if (obj) {
tmp = typeof obj === "object";
2026-07-29 08:29:29 +00:00
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = typeof obj.copy === "function";
2026-07-29 08:29:29 +00:00
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = typeof obj.fill === "function";
2026-07-29 08:29:29 +00:00
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = typeof obj.readUInt8 === "function";
2026-07-29 08:29:29 +00:00
}
return tmp;
};