decord/source/1427_isBuffer.js

24 lines
414 B
JavaScript
Raw Normal View History

2026-08-11 06:20:06 +00:00
// Module ID: 1427
// Function ID: 1428
2026-07-29 08:29:29 +00:00
// Name: isBuffer
// Dependencies: []
2026-08-11 06:20:06 +00:00
// Module 1427 (isBuffer)
2026-07-29 08:29:29 +00:00
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;
};