PIbd-21_Danilov_V.V._Intern.../Lab4/node_modules/is-shared-array-buffer/index.js

22 lines
454 B
JavaScript
Raw Normal View History

2024-01-09 05:30:48 +04:00
'use strict';
var callBound = require('call-bind/callBound');
var $byteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
module.exports = $byteLength
? function isSharedArrayBuffer(obj) {
if (!obj || typeof obj !== 'object') {
return false;
}
try {
$byteLength(obj);
return true;
} catch (e) {
return false;
}
}
: function isSharedArrayBuffer(obj) { // eslint-disable-line no-unused-vars
return false;
};