1.1.3 • Published 23 days ago
@teamteanpm2024/magnam-ipsum-possimus v1.1.3
@teamteanpm2024/magnam-ipsum-possimus
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
@libphamton/chatfanpage@libphamton/fb-group@npmmaintea/cautious-waddle@npmmaintea/glowing-broccoli@npmmaintea/potential-octo-dollop@npmmaintea/psychic-doodle@oraliepham/api-chat-fanpage-facebook@oraliepham/api-facebooknew@teamteanpm2024/aperiam-dolor-aliquid@teamteanpm2024/aperiam-fugit-error@teamteanpm2024/aperiam-similique-soluta@teamteanpm2024/architecto-alias-quod@teamteanpm2024/asperiores-atque-fugit@teamteanpm2024/aut-voluptatum-vero@teamteanpm2024/beatae-aliquid-id@teamteanpm2024/commodi-illum-occaecati@teamteanpm2024/consequuntur-enim-dignissimos@teamteanpm2024/consequuntur-voluptates-quod@teamteanpm2024/debitis-iure-atque@teamteanpm2024/dolores-beatae-possimus@teamteanpm2024/earum-illum-veniam@teamteanpm2024/earum-ipsam-aspernatur@teamteanpm2024/effective-octo-computing-machine@teamteanpm2024/exercitationem-rem-magni@teamteanpm2024/expedita-labore-ipsum@teamteanpm2024/iste-sapiente-possimus@teamteanpm2024/laudantium-autem-pariatur@teamteanpm2024/legendary-meme@teamteanpm2024/non-tempora-perferendis@teamteanpm2024/nostrum-deleniti-fugit@teamteanpm2024/odio-fugiat-in@teamteanpm2024/odit-voluptatibus-nobis@teamteanpm2024/perspiciatis-a-unde@teamteanpm2024/saepe-in-beatae@teamteanpm2024/sit-optio-enim@teamteanpm2024/temporibus-distinctio-in@teamteanpm2024/voluptate-facere-ducimus@teamteanpm2024/voluptatibus-reprehenderit-oditapi-chat-fanpage-facebookapi-chatfbapi-chatfb-test