1.1.3 • Published 23 days ago

@teamteanpm2024/magnam-ipsum-possimus v1.1.3

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

@teamteanpm2024/magnam-ipsum-possimus 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('@teamteanpm2024/magnam-ipsum-possimus');
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.

minimalPromisetsfetchworkspace:*Symbolecmascripteslint-pluginyupexpressionwaapicommand-linenativei18nspawncurlsanitizeoncestylingtypescriptdiffpostcss-pluginclassnamewgetinvarianttakeformsrangeerrorMaplrutoArrayextrastylesheetreact animationsyntaxlistenerscore-jscss-in-jsisConcatSpreadableprototype_.extendmonorepoasynclessfoldersliceauthdebugfull-widthtrimStartprefixcharactersstreamssetImmediatebluebirdArrayconfigurablewatchFileprotoECMAScript 2018east-asian-widthkeysECMAScript 2022watchingrobustmacoses-shim APIscheme-validationRxqueuedatesanitizationapparraybufferruntimefromartbounddomencryptioncreategetoptsomeerrorwatcherxssstyleguideES8less.jssetArrayBuffer#sliceperformanttypedarraysoutputnopeargumentbrowserlistvesta11ychinesetypesjsdifftimecommandremoveArrayBuffermkdirsweakmapYAMLtypequerystringString.prototype.matchAllcollectionlaunchECMAScript 2019harmonyrmreadfullshrinkwrapaccessibilitydescriptorcolumnspnpm9constprotobufwebsitepromisefast-copyiterateargvTypedArraymovedom-testing-libraryES7pluginstartermake dirFunction.prototype.nameflatteniereadableoperating-systemlastreal-timecommanderescapetrimRightexevisualcss lesswaitpoint-freecss variableparentsfastcloneenvguidtouchclitddArray.prototype.containsES3hasOwnfind-upserializationpreprocessorresolveconnectjson-schema@@toStringTagspeedtaskfseventsmiddlewarelinkfilefunctionstypeerrorgradients cssratelintesspecreduxexecstylesbrowserinterruptscolorsdataAsyncIteratoreslintpluginsigintfastvaluesframerinternal slotqueueMicrotaskFloat64ArraypicomatchequalmixinsimmutablesafetoStringTagdatastructureESnextauthenticationshimes5lockfilecomputed-typescallbindSymbol.toStringTagvariableshardlinkspyyamlArray.prototype.flattencolourinputjestmatchawesomesaucelimitutilityclassnames__proto__es7testingsymbolsstableregexpframeworkmkdirpInt8ArraytranspilersetPrototypeOfflagtc39redacteveryfast-clonestyled-componentsinstallerjsxtapbusyArrayBuffer.prototype.slicemomentjsonpathpositivepackage.jsonl10nassigncss nestingmatchespackage managerdayjsserializerassertssharedextendparentvalidjapaneseeslintflatMapcheckcopytacitdataviewpostcsscolumnnegativeimmerglobanimationjoiURLSearchParamsloggerintrinsictoSortedhasclonestreams2rmdirassertduplexWeakSetlengthless mixinsmkdirstructuredClonetoolsformattingasciigroupBynegative zeroES2019stylearrayObject.keysReactiveExtensionsObject.fromEntriesenderirqsignalsgetArray.prototype.includesObject.definePropertyjasmineclass-validatorhooksbrowserslistes-abstractfast-deep-copyimport-0gdprObservablestyped arrayObject.assignrapidregular expressionconfigxdgfastcopyprivateavamochareact-hook-formfunctionalqsUint8ClampedArrayutilmimeformatES5exitgesturesECMAScript 3expresskarmafastifyES2018writefixed-width256regexcjksuperstructjavascripteventsentriesreusebreakargsconsumebanneroptionObject.entriesless cssshelldependenciesMicrosoftwalkingapollooptimisturlsjQuerycoercibleprocesskoreansortinspectCSSfullwidthconcatMapBigInt64Arrayreducetermjson-schema-validationchaispinnerwindowsObservableschemestringextensionincludesfindLasthookformautoprefixerES2023user-streamsflagsthroatpropertytestervalidationlookfigletastWeakMapform-validationajaxtapebufferscharacterArray.prototype.flathttpseventDispatcherdefineslotbundlerjsonparsecensorstartyamlfile systemes2018prunextermforEachvalidatorprotocol-buffersnamewordwraptostringtagbatches6react posepipepolyfilles2015serializeloadingvaluegetPrototypeOfspring6to5watchbufferArray.prototype.findLastIndexSetsidecallboundlook-upsigtermbabelio-tssuperagentsymlinksdescriptiontrimLeftponyfillpathtypanionpurestatelessES2016textconcatCSSStyleDeclarationstatustypedes2017progressdirectoryredux-toolkititerationhelpersRFC-6455cryptocmdrandomTypeBoxECMAScript 2020call-bindtypesafegetOwnPropertyDescriptorStreamairbnbUnderscoreReflect.getPrototypeOfxdg-openbabel-coretypedarrayawait3dcallbackprop[[Prototype]]languagebindECMAScript 2021currieddropcryptRegExp#flagsemojiexecutableupmimetypesinstallbundlingweaksetregularreact-hooksview0modulesspinnersjson-schema-validatorrm -rflogchildutil.inspectWebSocketsthrottleschemaECMAScript 6channeleditorchromemakewarningarktypeES6compile lesscorsgraphqlvalidatefsurlgenericsTypeScripttypeofES2020moduleJSONconcurrencynodedeterministicelectronrm -frassertionopenECMAScript 5dataViewgradients css3telephonewhichsharedarraybufferObject.valuessignal.envformpromisesnested cssreact-testing-libraryrecursiveURLtestcodesfunctionposeflatparserECMAScript 2017WebSocketcollection.es6queryemitless compilerArray.prototype.filterdirgroupmatchAllstringifierjwtxhrlazyBigUint64Arrayuninstallwalkkeyfantasy-landwhatwgefficientttyexit-codedeeppreserve-symlinksObjectJSON-SchemaArray.prototype.flatMapArray.prototype.findLastES2017Streamsdeep-copyhandlersFloat32ArraydeepcloneRxJSeventEmitterramdahttppersistentzodopeneransidependency managerapideepcopyclientbyteLengthcontainsES2022ES2015filterUint8ArrayoffsetindicatorquotewebnodejspasswordpackagesjsfindupsymlinkhashisECMAScript 7readablestreamenumerabletrimEnddotenvchromiumInt32Arraytrimes8shamcallmobilerequiresetterbddreducerconsoleregular expressionsthreedeleteUint16ArraygetterwrapObject.getPrototypeOfString.prototype.trimdescriptorsobjcssjsdomopensshebangoptimizerfindLastIndexenvironmentdefinePropertyterminalrequestrgbdefaultnumberajvstringifyInt16ArrayECMAScript 2015estreecompare
1.1.3

23 days ago

1.1.2

24 days ago

1.0.2

25 days ago

1.0.1

26 days ago

1.0.0

26 days ago