CoolFace
Apppublic

HarshvardhanCn01/Voice-Assistant

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
get.js31 linesDownload Raw Back to dunder-proto
1'use strict';2 3var callBind = require('call-bind-apply-helpers');4var gOPD = require('gopd');5 6var hasProtoAccessor;7try {8	// eslint-disable-next-line no-extra-parens, no-proto9	hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;10} catch (e) {11	if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {12		throw e;13	}14}15 16// eslint-disable-next-line no-extra-parens17var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));18 19var $Object = Object;20var $getPrototypeOf = $Object.getPrototypeOf;21 22/** @type {import('./get')} */23module.exports = desc && typeof desc.get === 'function'24	? callBind([desc.get])25	: typeof $getPrototypeOf === 'function'26		? /** @type {import('./get')} */ function getDunder(value) {27			// eslint-disable-next-line eqeqeq28			return $getPrototypeOf(value == null ? value : $Object(value));29		}30		: false;31