mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-26 03:44:44 +01:00
21 lines
454 B
JavaScript
21 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;
|
|
};
|