1.0.0 • Published 22 days ago

@f1stnpm2/suscipit-nisi-cupiditate v1.0.0

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

Non-Enumerable Read-Only Accessor

NPM version Build Status Coverage Status

Define a non-enumerable read-only accessor.

Installation

npm install @f1stnpm2/suscipit-nisi-cupiditate

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 setNonEnumerableReadOnlyAccessor = require( '@f1stnpm2/suscipit-nisi-cupiditate' );

setNonEnumerableReadOnlyAccessor( obj, prop, getter )

Defines a non-enumerable read-only accessor.

function getter() {
    return 'bar';
}

var obj = {};

setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );

try {
    obj.foo = 'boop';
    // throws <Error>
} catch ( error ) {
    console.error( error.message );
}

Notes

  • Non-enumerable read-only accessors are non-configurable.

Examples

var setNonEnumerableReadOnlyAccessor = require( '@f1stnpm2/suscipit-nisi-cupiditate' );

function Foo( name ) {
    if ( !(this instanceof Foo) ) {
        return new Foo( name );
    }
    setNonEnumerableReadOnlyAccessor( this, 'name', getName );
    return this;

    function getName() {
        return name;
    }
}

var foo = new Foo( 'beep' );

try {
    foo.name = 'boop';
} catch ( err ) {
    console.error( err.message );
}

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


Copyright

Copyright © 2016-2024. The Stdlib Authors.

ttyFloat32ArraywatchingECMAScript 2023sharedarraybufferSetECMAScript 7spinnerscolumnswordbreakperformantprivate datatestersigintgrouplibphonenumberassertsparentsWeakMapECMAScript 2015typesafeES3argvRegExp.prototype.flagspushisimmutablestylesenvironmentSymbol.toStringTagnested csstestingObject.fromEntriesbreakES2019filterless mixinscolumnxhrstructuredClonejsdifffull-widthemitcharactersgradients css3installerassertxtermObservablestylesheetratelimitsyntaxerrorrestpathObject.valuesgraphqltsnegativesetsymbolwhatwgreact-hook-formES2016metadatapostcss-plugindotenvlimitspinnerurlpredictable256eslint-pluginsyntaxiteratorutilitieshookforminputObject.isstreams2performancepersistentcallbindtapbrowserliststableyupthrottleconsumedeletelrupnpm9qsTypedArraycheckhttpclassnamelessObject.definePropertyjsdomtypedlesscsscontainsstringifierstyled-componentsagentdynamodbInt32Arraymkdirshelltyped arraychromechineseiereducerm -frcorsutilURLpackagescommandstatelessprotobufmimetc39negative zerocore-jswarningindicatorerrorkeysObject.getPrototypeOfsequencevalidwrapcss variableclasses$.extendartwatcherreal-timeinternalchannelcloudfrontcollection.es6Int16ArrayargparsefilemoduleseventsimmerzeroECMAScript 2016es2016typejasmineinstallString.prototype.matchAlltypeerrorponyfillcloudformationflatMapexitdeepclonewaflinewrapdebugjsonpathlockfilewgetprocesssymlinkkinesisequalrm -rfpicomatchbundlerexpressBigUint64ArrayauthenticationeslintpluginsqsdatasettingsawsvaluesinspectObjectReactiveXiterationCSSStyleDeclarationjsxstringcryptoArray.prototype.flattenisConcatSpreadablepropertiestypedarray__proto__regularcloudwatchrapidtypescriptforEachfastlinuxfindLastIndexbeanstalkWebSocketsuninstallhasOwnECMAScript 5tddiamhooksObservablesairbnbremovefast-copyArray.prototype.flatMapprettytakecopydependency managerjestapicommand-linetostringtagspeedfunctionalenvsetteroptimistflagsl10nES2017groupBysearchframeworkRFC-6455walkregextimeasciiPushobjectfastifyvpcreadabledescriptionRxJSYAMLbddRegExp#flagsArray.prototype.findLastmixinsarraysbuffersworkflowtelephoneutilitynopeES8flateslengthes2017regexpcalleverytestmatchAllexpressionboundfolderfpssortedlazyargsrdsfindupdirectoryconfigurableidleJSONautoprefixercompile lesstypeshardlinksparentnodejsautoscalinginterruptsflagamazonchaimakewritablereact-testing-librarykarmaURLSearchParamsMaphandlersoffsetAsyncIteratorschematypaniongdprshrinkwrapansishebangsignalimportexportcolourHyBireducertouchmiddlewareoutputentriesArrayBufferreadeslintconfigtrimStartMicrosofts3mapreducestylereduxi18nObject.keysESnextES2015moveio-tsArrayBuffer#slicewatchFilees-shim APIquerystringratedependenciesbundlingcodesphoneelmcss-in-jsrequestaccessorobjrgbbluebirdformscorematchestrimEndwindowstextcssidInt8ArraycallboundhashvaluetoolkitsignalsECMAScript 6ES2022definecallbackclonees2015streamsvestpatchencryptionstatedeepquotelistenersmodulesinatraelbes-shimsIteratorrestfuliteratenativevisualwalkingsymbolsasynces6sesUint16Arrayassertionrequireunicoderfc4122workspace:*charactermulti-packagethroattslibfulljsassignoncestarterWeakSetstylingfixed-widthgetintrinsictrimRightes5internal slotmapclibuffermatchflattengetterenderwhichArrayfile systemReflect.getPrototypeOfredactinferenceString.prototype.trimsymlinksajaxlinkdescriptormonorepocjkES7stdlibebstapepackagehasFunction.prototype.namewriteconfigloggercreateparsingownfullwidthnodelinteventEmitterruntimeescapeStyleSheeta11ycss lessarktypeerror-handlingbyteLengthvalidationReactiveExtensionsmime-dbhas-ownrangeerrorplugindescriptorsESform-validationfindLastincludesarrayWebSocketfind-upArray.prototype.includesPromisesharedauthfunctionsSymbolequalityeslintargumentparserbatchelectronfluxless.jssetImmediatedeep-copyserializeformattingES2018colorsjoisuperstructstatusuuidrouterexecfselasticacheloadingschemeloadbalancingES2023swfcompilerpackage.jsoncachediffwatchfastclonefromworkercoerciblelook-uppositiveweakmappipeextendArray.prototype.containscrypt@@toStringTagwordwraplookjsonsortES5getOwnPropertyDescriptordeep-cloneconsoledebuggeres7make dirvalidatepyyamlmobilehelpersvariablestermproxyserializerslotTypeBoxomitoperating-systemwidthcompareinJSON-SchemapropertyduplexECMAScript 2020awaitcloudsearchmochaFloat64ArrayObject.assignstreamutil.inspectbusymimetypesreuseconcurrencyECMAScript 2022gradients cssnpmstoragegatewaymacoscss nestingecmascriptajvcloudtrailsomesimpledbqueueMicrotaskquerysafecall-bindECMAScript 2021protoconcatMapfiglettrimfseventsdropstringifyes2018browserUnderscore0minimaltoSortedArray.prototype.flatUint8ClampedArraydefinePropertyserializationintrinsicsigtermprototypetaskvariables in cssglaciernamesbyteOffsetregular expressiongetkoreanprefixrmdirexit-codetoobjectprivatetrimLeftbindirqcensorslicepromisecode pointstypedarraysfast-deep-cloneObject.entriescollectionopenyamlES2020limitedfast-deep-copyArray.prototype.filterlastcoloremreventDispatcherpostcssweaksetinvariantdomECMAScript 2018logcall-boundcurlfinddeterministicrobustECMAScript 2019hotfast-clonepreserve-symlinksestreebannerformbrowserslistcomputed-typesastemoji.envjQueryregular expressionsbootstrap csses8sidedataviewliveStreamwaitprogressnumberdatastructureECMAScript 3east-asian-widthsetPrototypeOfbcryptES2021globArrayBuffer.prototype.slicegenericsawesomesauceupenumerablegetPrototypeOfES6BigInt64ArrayapollorandomrecursivehasOwnPropertytraversespecec2react-hooksless cssfetchtoolsendpointefficientfunctionrmreplayextensiontypeofconnectless compilerdatejwttoStringTag-0snsconcatreadablestreampolyfillfastcopylanguagegetoptnamearraybuffermruterminaljapaneseclassnamessameValueZerosuperagentzod[[Prototype]]higher-ordercircularresolveshammergemkdirpUint8Arraydayjsdom-testing-librarywebchromiumbootstrap lessapp_.extendimportavadataViewcommanderkeyroute53momentprunehttpsqueuepropprotocol-buffersStreamspromisesformatECMAScript 2017preprocessorjavascriptextraArray.prototype.findLastIndex
1.0.0

22 days ago