UNPKG

reflect.getprototypeof

Version:

An ES2015 mostly-spec-compliant `Reflect.getPrototypeOf` sham/polyfill/replacement that works in as many engines as possible

15 lines (11 loc) 350 B
'use strict'; var implementation = require('./implementation'); var getProto = require('get-proto'); module.exports = function getPolyfill() { if (typeof Reflect === 'object' && Reflect && Reflect.getPrototypeOf) { return Reflect.getPrototypeOf; } return getProto ? function getPrototypeOf(O) { return getProto(O); } : implementation; };