source: imaps-frontend/node_modules/is-shared-array-buffer/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 481 bytes
Line 
1'use strict';
2
3var callBound = require('call-bind/callBound');
4
5var $byteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
6
7/** @type {import('.')} */
8module.exports = $byteLength
9 ? function isSharedArrayBuffer(obj) {
10 if (!obj || typeof obj !== 'object') {
11 return false;
12 }
13 try {
14 $byteLength(obj);
15 return true;
16 } catch (e) {
17 return false;
18 }
19 }
20 : function isSharedArrayBuffer(obj) { // eslint-disable-line no-unused-vars
21 return false;
22 };
Note: See TracBrowser for help on using the repository browser.