getProto.js 382 B

123456789101112131415
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true);
  4. var $ArrayProto = GetIntrinsic('%Array.prototype%');
  5. module.exports = originalGetProto || (
  6. // eslint-disable-next-line no-proto
  7. [].__proto__ === $ArrayProto
  8. ? function (O) {
  9. return O.__proto__; // eslint-disable-line no-proto
  10. }
  11. : null
  12. );