getProto.js 311 B

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