1.0.2 • Published 10 days ago

@npmteam2024/est-eveniet-deserunt v1.0.2

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

@npmteam2024/est-eveniet-deserunt

npm version Code Size GitHub license Commitizen friendly Jest Tests GitHub Actions/CI npm downloads

Table of Contents

Getting Started

deepObjectKeyAlternator is a versatile utility function that allows you to recursively parse an object or array of objects, applying a key mapping to rename object keys. It's particularly handy when you need to transform the structure of nested objects while preserving the original data.

Installation

You can install @npmteam2024/est-eveniet-deserunt using npm:

npm install @npmteam2024/est-eveniet-deserunt

or yarn:

yarn add @npmteam2024/est-eveniet-deserunt

or pnpm:

pnpm add @npmteam2024/est-eveniet-deserunt

Features

  • Recursively parses nested objects.
  • Customizable key mapping with intellisense support.
  • Supports arrays (without intellisense support).
  • Preserves the structure of arrays.

Usage

Here's how you can use deepObjectKeyAlternator in your projects:

ECMAScript Modules (ESM) Import

import { deepObjectKeyAlternator } from "@npmteam2024/est-eveniet-deserunt"

CommonJS (CJS) Import

const { deepObjectKeyAlternator } = require("@npmteam2024/est-eveniet-deserunt")

Examples

For Objects (with intellisense support)

import { deepObjectKeyAlternator } from "@npmteam2024/est-eveniet-deserunt"
// or const { deepObjectKeyAlternator } = require("@npmteam2024/est-eveniet-deserunt")

// Define your input object
const inputObject = {
  id: 95,
  name: "Your Input Data",
  // ... Your input data ...
}

// Use deepObjectKeyAlternator to parse the object
const parsedObject = deepObjectKeyAlternator(inputObject, {
  id: "customId",
  name: "customName",
  // ... Your key mapping ...
})

console.log(parsedObject)
// {
//   customId: 95,
//   customName: 'Your Input Data',
//   // ... Your input data ...
// }

For Arrays (without intellisense support)

import { deepObjectKeyAlternator } from "@npmteam2024/est-eveniet-deserunt"
// or const { deepObjectKeyAlternator } = require("@npmteam2024/est-eveniet-deserunt");

// Define an array of objects
const inputArray = [
  {
    id: 1,
    name: "Item 1",
  },
  {
    id: 2,
    name: "Item 2",
  },
  // ... More items ...
]

// Use deepObjectKeyAlternator to parse the array of objects
const parsedArray = inputArray.map((item) => {
  return deepObjectKeyAlternator(item, {
    id: "customId",
    name: "customName",
    // ... Your key mapping ...
  })
})

console.log(parsedArray)
// [
//   {
//     customId: 1,
//     customName: 'Item 1',
//     // ... Your input data ...
//   },
//   {
//     customId: 2,
//     customName: 'Item 2',
//     // ... Your input data ...
//   },
//   // ... More items ...
// ]

License

This package is licensed under the MIT License - see the LICENSE file for details.

ES2022yuppackagesprivatesetImmediateclassnameTypedArraypackageconfigurablecoercibleregexs3ReactiveXcloudfrontuninstallECMAScript 2021equalstreamObject.fromEntriesargsUnderscoresigtermreduceratepromisesapollomimeString.prototype.trimdeepclonelimitedchromiumsideelbwatchingRxexecerrorcss-in-jsreactdropgetOwnPropertyDescriptorwhatwgefficientwindowsdirectoryArrayBuffer.prototype.sliceArray.prototype.flatzodfsjwtstringifyio-tsgettercommandES2016es8nodejsmochashrinkwrapjson-schema-validationvalidateharmonyagentparsingslicefullwidthtrimEndinspectvalidnameformtrimelectronArray.prototype.filterredux-toolkitreduxcjkexitcollectioninternal slotInt16Arrayparentsphonejasmineremovesigintgenericsjsdiffdescriptorsendpointfigletbddregular expressionsglaciersymbolsjson-schemaajaxbatchxhrpopmotionidlewalkingutilitiesmovemapreducelanguagelrucryptojsoninputdefinePropertyconnectstatelessisConcatSpreadabletouchajvairbnbreadablestreamutilcolumnsmomentfolderspringflagesdeep-cloneObject.definePropertystyled-componentsinferencesuperstructsharedarraybufferFloat32ArrayInt32Arrayoptimistsyntaxtypescriptes2018arrayprocessiteratewaapiconcatMaplookeventsdataViewES6fseventsfunctionflattenless mixinsrequestpropertiesframeworkclispecdeepcopydeleteregularbootstrap less256classeswatchFileperformantmimetypesmergedateasync@@toStringTagqueuelook-upES2015kinesisquotecurltrimRightformattingPushwritebluebirdUint8ClampedArraycore-jsviewcharacterstatusmkdirsisECMAScript 2020ObjectsymlinksstylesheetMapvariables in cssrangeerrorspinnerssomesymbolawaitemittypaniondataviewFunction.prototype.namejoiawesomesauceserializationsortfind-upnpmjsfast-deep-copycorstoSortedinternaljavascripteslintpluginvestjson-schema-validatormacosec2syntaxerroruser-streamssetrecursivemiddlewareshamObject.valueswordbreak[[Prototype]]matchesBigInt64Arrayequalityassertionincludeschrome6to5iammonoreponodeWeakSetimportenumerableECMAScript 2015formatauthbeanstalkStreamkeysrgbrm -frcloudtrailString.prototype.matchAllavaObject.keysRxJSpluginreact-testing-librarycloudformationgroupBymake dirpackage managerserializerchaiSetcomparesetPrototypeOfgraphqlregexppolyfillworkspace:*takeconcatextendRFC-6455error-handlingimmerECMAScript 2018symlinkfastes7compile lesstddclassnameschecktelephoneastqueueMicrotasktestlistenersstyleslinewrapwhichdatastructuregroupshebangPromisebyteLengthcall-boundtoArrayfromcompilerschemeparentbytematchrapidcensorimmutableFloat64ArrayObject.getPrototypeOfcollection.es6workflowlinuxweakmaphandlersoperating-systemArray.prototype.includesTypeScriptrmdirES8moduleReflect.getPrototypeOftestersnsdires-abstractloadingansifast-deep-clonedragsharedpropertyfpes2015dynamodbtranspilerebslesscssxssroute53queryimportexporthelpersassertsinvariantsequencetasktoStringTagpurediffECMAScript 3throatshimmkdirpecmascriptwaitaccessorhttptslibdeep-copypostcsshashUint8Arraytyped arrayunicodeRegExp#flagsnumberrandomframercloudsearchstyleautoscalingiereact-hook-formflagsprototypehardlinksvarpromiseoutputponyfillglob.envjsonpathrdsdescriptionargvnegative zeropyyamlconstCSSStyleDeclarationstructuredCloneUint16Arrayes-shim APIdescriptorrfc4122es-shimsgradients csshooksYAMLStreamstacit_.extendarraybufferArray3dsortedsimpledbmatchAllposebabel-corebootstrap cssnested csscharactersfunctionsreact animationoptimizertextenvpushruntimespinnerArrayBuffer#slicecurriedECMAScript 2017reducerwalkIteratorintrinsicmodulespreserve-symlinksvalidationsuperagentutilitysearchnamespersistentlength0exit-codepositivechinesewritablepoint-freeflatMapprettyencryptioncommand-linefixed-widthexpressionstreamsjapanesebrowserlistJSON-SchemafastifyESnextgradients css3hookformpnpm9eventEmitterjsdomprivate datattyargparsedebuggercalllibphonenumberlimitECMAScript 2016loggerObservablequerystringObject.isdeterministicperformancetapeoptionECMAScript 2022dependency manager$.extendregular expressionmulti-packagestreams2starterjsxboundrequirecssgesturesexpressURLsettingsomitjQueryES2019minimalaccessibilitystylinglesstypeMicrosoftmetadatacommanderreact-hooksstringbcryptyamlprogresstypesafevpcgettc39irqfindupmapescapeuuidredacttostringtagtraverseswfsqsES5styleguidesameValueZeroES2020deepwrapduplexslotloggingcall-bindloga11yprotocol-buffersfull-widthshelles6animationbrowserslistStyleSheetes2017picomatchcopyfantasy-landObject.entriespreprocessorcallbackeverywebhttpsfast-copyfindassertpipetsspeednativeterminalsanitizationhasstoragegatewayprotobufsafeiteratorfilterSymbol.toStringTagconcurrencyparserbundlingbreakECMAScript 7installerObservablesclientopenreact poseURLSearchParamsmakedependencieshigher-orderJSONasciicolorweaksetinstallESawsvaluesproxybannereast-asian-widtheslintschemathreestableCSSi18nES2023interruptslazyguid-0Uint32Arrayutil.inspecttoolsentriescodesconfigtoolkitfpsparseES7arktypegdprclass-validatorpostcss-pluginl10nrobustwatcherdefinevalueeslint-plugincss lessfastclonevisualbabelflatless compilergetintrinsicES3transpilefetchcircularobjectcloudwatchtestingextensionupkarmawarningcss variablelintdayjsECMAScript 5formskoreanelasticachemkdircss nestingdebugsignalbufferBigUint64Arraylockfilescheme-validationqsfastcopyreadablethrottlekeyES2017getoptcode pointsWebSocketspatchECMAScript 6authenticationestreeresolveSymboloffsetWeakMapmime-dbArray.prototype.flatMapHyBisignalsworkerdombrowserextrafindLastIndexform-validationendertrimLeftES2018amazonassigntimetrimStartcolourapimixins__proto__mrutypeofloadbalancingchannelObject.assigncorewatchdatatapargumentramdaxtermreadeventDispatchercacheless cssonceletbindratelimitsanitizeeslintconfigwordwrapprotofile systemECMAScript 2023consoleArray.prototype.findLastIndexreuserm -rfmobilehasOwnclonepropfilegetPrototypeOfes2016
1.0.2

10 days ago

1.0.1

11 days ago

1.0.0

11 days ago