1.0.0 • Published 7 months ago

@a-2-c-2-anpm/officiis-provident-perspiciatis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@a-2-c-2-anpm/officiis-provident-perspiciatis Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Given an object and a property, replaces a property descriptor (or deletes it), and returns a thunk to restore it.

Example

var mockProperty = require('@a-2-c-2-anpm/officiis-provident-perspiciatis');
var assert = require('assert');

var i = 0;
var object = {
	a: 1,
	get b() {
		i += 1;
		return 'b ' + i;
	}
};

assert.equal(object.a, 1);
assert.equal(object.b, 'b 1');
assert.equal(object.b, 'b 2');

var restoreA = mockProperty(object, 'a', { 'delete': true });
assert.equal('a' in object, false);

var restoreB = mockProperty(object, 'b', { value: 42 });
assert.equal(object.b, 42);

restoreA();
assert.equal('a' in object, true);

restoreB();
assert.equal(object.b, 'b 3');

Tests

Simply clone the repo, npm install, and run npm test

Security

Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.

$.extendponyfillopenwrapgraphqlpropertiesloadingpredictablea11yless compilerwatchFiledatalengthcorsvariables in cssinputgradients csssequencewordwrapWebSocketsSymbol.toStringTagworkspace:*tostringtagsimpledbinstalltypedarraysesES2019touchsortECMAScript 6momentcodesworkercensorrequireprefixsymbolArrayBuffer.prototype.sliceuuidiamrfc4122folderconcatformattingflatMapmetadatagetintrinsicfast__proto__multi-packageendergetcloudwatchremovestatelessschemahotextraoptimizerfindupshrinkwraptrimEndObservable[[Prototype]]assertionmake dirlogginglimitoutputcharacterwritewgetaccessorparserupfast-copyprivatedeep-copyspeedassertslanguagenameses5ESfastcloneroutingeast-asian-widthsameValueZeroemojisymlinksmatchassertkoreanqueueoptimistdatastructureserializehelpersstatees2018beanstalkECMAScript 2019protogetPrototypeOfieWebSocketspinnerregexpstringifierstylingpackagesquotetoobjectapidropfsasyncredux-toolkitpostcss-plugincolorrandomgradients css3idlelazytrimStartprettyexpressqueueMicrotaskkarmaclonelimitedMappicomatchJSONclassnamesstreams2code pointsawesomesaucedebuggerestreegetOwnPropertyDescriptorjsdiffjsdomesdeepcopyperformanceequal-0String.prototype.trimconfigBigUint64ArrayJSON-Schemalook_.extendObject.definePropertyjsxobjcorematcheskeyschromeweakmapBigInt64ArrayECMAScript 2022es-abstractObject.isvariablestypesinstallerbusyentriesPushdotenvlintdescriptorflagsisFloat64Arraymime-dbagentsetterCSSStyleDeclarationtyped arrayfromcss variablenumbergdprWeakSetmatchAllregular expressionwafworkflowwalkutilitiespasswordnopevalidObject.assigncompilerArray.prototype.findLastelmcolumnmimees-shim APIchinesechromiumArray.prototype.flattenautharraybufferwaitInt16Arrayenvironmentvisualvestinspectshimyamlslicetestingassignes8256httpxhrmiddlewareweaksetomitrecursiveHyBieslintconfigdefinePropertysharedarraybufferserializerfluxecmascriptnodejserrorpromisecolourargsES2020configurablestreamswatchermoduledeepclonejwthookssettingsjQueryRFC-6455typedweb@@toStringTagunicodedirectoryshellincludesSetpnpm9createimportexportfindsortedfunctionaljavascriptdescriptionstartermkdirszerofastifylesstoolkitprogresscolumnsclassesqsdependenciesloadbalancinglockfiletypescriptguidUnderscoreindeleteiterationObject.fromEntriesstylesheetreplaymergearrayflattypeoffixed-widthreact-testing-librarystableownserializationreal-timehttpsES2022wordbreakinferenceObject.entriesarrayspreserve-symlinksec2rangeerrorparentsReflect.getPrototypeOflook-upeventDispatcherpushflattenbreakpreprocessorruntimeawsnpmsyntaxmobileconsolemapreduceES6RxJSpackage.jsonnested csslesscsses2017figletminimalnamepackagestructuredCloneURLSearchParamsES2017clireducerfindLastIndexstylesapollocopyfile systemdataViewWeakMapansioncecheckespreegroupByECMAScript 2020searchStyleSheetwidthbootstrap lessbddlibphonenumberuninstallString.prototype.matchAllcss nestingnegative zeromodulesvaluesairbnbbyteOffsetbinds3syntaxerrorpostcsspositivepipeoffsetrapidECMAScript 7eventEmitteraccessibilityasciiprotobufiteratecontainsFunction.prototype.nameES2016Object.getPrototypeOfcommandeslint-pluginrdsSymbolspecyupwarninggetterform-validationRxes-shimsiteratorreadablecachebrowserjsonpathcharactersbluebirdhasOwnPropertyenumerableavaartRegExp#flagsimmerES2015emrviewtypesafeemitcomputed-typesArray.prototype.filtertapstyleguideObjectequalityajvbundlingclientshebangfiltertermfseventsbuffertoArrayfpsArray.prototype.findLastIndexgetoptpyyamlmruphoneregular expressionsslotzodextensiontypereduxglaciertextstreamArray.prototype.flatMaptimesetPrototypeOfcsstakeescapesetImmediatehas-ownlastfetchObservablesObject.valueslinewrapcloudformationtrimLeftless cssinternal slotfull-widthroutereact-hook-formtapesqslinkAsyncIteratorECMAScript 3hasheverylocationrmframeworkECMAScript 2015fast-deep-copydataviewRegExp.prototype.flagsredirectECMAScript 2018vpcautoprefixerpatch.envutil.inspectthroatcircularcoerciblediffes2016curltscollection.es6schemeES8compareArrayBuffer#slicedebugcallbindmovebrowserlistES2018traverseefficienttypanionfilepackage managerl10nroute53Streamsfullidkey
1.0.0

7 months ago