Pibd-21_Alekseev_I.S._Inter.../IP/node_modules/is-shared-array-buffer/index.js
VanyaAlekseev ccc3e790bb lab2
2023-12-03 16:59:28 +04:00

22 lines
454 B
JavaScript

'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;
};