1.0.0 • Published 23 days ago

@rabiepenpm/iusto-quam-atque v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

getPrototypeOf

NPM version Build Status Coverage Status

Return the prototype of a provided object.

Installation

npm install @rabiepenpm/iusto-quam-atque

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var getPrototypeOf = require( '@rabiepenpm/iusto-quam-atque' );

getPrototypeOf( value )

Returns the prototype of an input value.

var proto = getPrototypeOf( {} );
// returns {}

Notes

  • In contrast to the native Object.getPrototypeOf, this function does not throw when provided null or undefined. Instead, similar to when provided any value with no inherited properties, the function returns null.

    var proto = getPrototypeOf( Object.create( null ) );
    // returns null
    
    proto = getPrototypeOf( null );
    // returns null
    
    proto = getPrototypeOf( void 0 );
    // returns null
  • Value arguments other than null or undefined are coerced to objects.

    var proto = getPrototypeOf( 'beep' );
    // returns String.prototype
    
    proto = getPrototypeOf( 5 );
    // returns Number.prototype

    This behavior matches ES6/ES2015 native Object.getPrototypeOf behavior. In ES5, the native Object.getPrototypeOf throws when provided non-object values.

Examples

var getPrototypeOf = require( '@rabiepenpm/iusto-quam-atque' );

var proto = getPrototypeOf( 'beep' );
// returns String.prototype

proto = getPrototypeOf( 5 );
// returns Number.prototype

proto = getPrototypeOf( true );
// returns Boolean.prototype

proto = getPrototypeOf( null );
// returns null

proto = getPrototypeOf( void 0 );
// returns null

proto = getPrototypeOf( [] );
// returns Array.prototype

proto = getPrototypeOf( {} );
// returns {}

proto = getPrototypeOf( function foo() {} );
// returns Function.prototype

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

collection.es6iterationtyped arrayhttpschaijson-schema-validatorprotocode pointscoerciblegroupconcatsortbootstrap cssarrayRegExp.prototype.flagsescapepasswordshimscheme-validation256clientinstalleriteratorECMAScript 2019fasterror-handlingmimepreserve-symlinksauthreadablemodulescensorutilposefiltertesterArrayBuffercallbackequalsomecheckes2016Array.prototype.findLastfindLastIndexletYAMLJSON-SchemaprogressECMAScript 2023react-testing-librarystructuredClonesymbolstsliblengthxhrtapefull-widthUnderscoreecmascriptsortedObject.assignbounddependency managerparsedataviewexecUint8Arraydropio-tsinspectslotoffsetlesscssajvtrimLefthttpdotenvmatchesnameopentimeframershrinkwrapclisideparentsymbolonceupargparseidleparsersharedencryptionregexptakeomitlook-upES2020telephone6to5querystringarraysarktypepyyamlObject.getPrototypeOfprivate datapolyfillflattenautoprefixerrmjsdomArrayinternal slotschemeserializationdeepclonefigletprocesshigher-ordertapECMAScript 2018testinggetintrinsicpipewrapRegExp#flags_.extendthreeasteast-asian-widthES2023rm -rfObjectjsonmatchwatcherimportwordwrapstatuslruconsoleajaxeslintplugininferencea11yindicatorexpressiewritablecolumnsvalidsymlinks$.extendvisualcolumnstylesfast-copystreamstraversehardlinkstrimRightfiletc39enderformterminternalStreamscolourreact posestringifierfindupasyncgetoptwarningfunctionalregular expressionses7yupdescriptorlinuxassignWeakSetcacheStreamregexconfigurabletypanionstringpropoptimizerstringifyUint8ClampedArraymodulerandomes2018form-validationbuffersworkspace:*jsonschemamovegetOwnPropertyDescriptortypedarrayString.prototype.trimtextfolder[[Prototype]]lockfileFloat64Arraybrowserlistthrottledeepcurlreact-hook-forml10nfile systemutilitysameValueZeroAsyncIteratortypescriptBigInt64ArrayvaluesstatelessgdprdirparentssearchoutputfromdeepcopytypesmonorepocreatebyteLengthWebSocketvesttoobjectfunctionmobilejssettingscss variableoperating-systemclassnamesentriesoptimistless.jspackage managertrimEnd-0corsSymbol.toStringTagduplexURLSearchParamsUint16ArrayimmutablecorecsssigintconfigminimalECMAScript 3efficientpositivedateestranspilemomentcss-in-jsreadablestreamhookssigtermprototypefastcopyfast-deep-copystreamstdlibfulltoolssharedarraybufferlinkmakedefineeverynested cssvariables in csscircularemojiless compilerloggingESECMAScript 2022nodereuseArray.prototype.flattencompile lessconcatMapmruzeroReactiveExtensionsratelimitnegativebootstrap lessshellpackage.jsonbluebirdrfc4122syntaxvalidatoreventDispatchercjkkeyguidrequestweaksetspinnerses-abstractsignalsinputpreprocessoraccessibilityObservablejwtuuidpostcsspromisesflagsgetqueueMicrotaskrangeerrorinvariantmacosArrayBuffer.prototype.slicelimitforEachargses-shim APIfixed-widthES7regular expressionshamtoArraywaitairbnbratespecdebugsetPrototypeOfObject.ismatchAllPushWebSocketsvariablesruntimecontainsviewHyBiArray.prototype.containsextensionArray.prototype.flatformsURLsyntaxerrorextendwaapimake dirES2022walkingjson-schematranspilerpersistentgetPrototypeOfhasOwnES2015setBigUint64Arrayreact animationbusyharmonypatchReflect.getPrototypeOfArray.prototype.includeses2017valueredactinstallbddargvintrinsicerrorstylesliceansiloggerutilitiesformatanimationECMAScript 2015ponyfillreal-timetostringtagaccessorxtermurlserializebundlingeslintconfigObject.entriesframeworkcall-bindreduxdescriptorsArrayBuffer#sliceassertregularES3assertsObservablesprotobufwatchassertionES2016eslint-pluginECMAScript 2017flagbabelstylesheetInt8ArrayJSONhandlersconcurrencystyleguidePromiseES5ES2019debuggernopecodesperformantdeletedeep-copyworkerprettyES2018promiseArray.prototype.filtereslintes6environmentbrowserslistWeakMapstarterunicodetypeofrm -frwebargumentlibphonenumbercompilerirqbrowserreadeventEmitterwindowscallcharacterqsobjfunctionscore-jsquotesequencees2015toStringTagTypeBoxgradients cssrmdirthroatjestrecursivebufferbabel-corewatchingES8callbindelectronMapchromiumhashcomparedomfetchisRFC-6455nativespeedstyled-componentsqueueobjectlogawesomesauceenvexpressiondayjsextraremovebyteOffsetwhatwgestreeavacommanderECMAScript 6IteratorsymlinkgroupBycall-boundtoolkitFunction.prototype.nameObject.definePropertychineseArray.prototype.flatMapbindES6performance3dinterruptstypesafefind-upfast-clonecss lesswritemime-dbvarcommand-lineprefixMicrosoftlistenerstssignalTypeScriptoptiontrimjson-schema-validationjavascriptES2021picomatchstylingpluginmkdirreact-hooksartconstclonenodejsequalityimmerkeysclassnamekarmattyquerycollectionsafenegative zerocss nestingjasmineauthenticationwalkkoreanprunevalidationSymbolreducerpushdeep-clonecomputed-typeswgettypedarraysclass-validatorclassespropertyutil.inspectserializerdatastructureless csslimitedlintchromeESnexttoSortedspringfullwidthsuperstructES2017Object.fromEntriessuperagentrgbflatMapi18ndirectoryzodpostcss-pluginRxtypeerrorapollohookformhaslastmkdirpeventstaskreducedataViewfseventsmocharedux-toolkitcryptostabletypeECMAScript 2021graphqlECMAScript 2016widtharraybufferCSSStyleDeclarationrequiretddexit0fsReactiveXprotocol-bufferspackagesenumerablespinnerbcryptawaitObject.keysRxJSschemaexit-codejsxjsdiffcommandInt16ArrayArray.prototype.findLastIndexlinewrap
1.0.0

23 days ago