1.0.0 • Published 1 year ago

@ptkhanh94npm/ex-explicabo-animi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@ptkhanh94npm/ex-explicabo-animi npm NPM Downloads

Grab Wizard is a lightweight JavaScript package for navigating and retrieving values from nested data structures.

Install

You can install the package using npm:

npm install @ptkhanh94npm/ex-explicabo-animi

Usage

const { grabValue, grabPath } = require("@ptkhanh94npm/ex-explicabo-animi");

var person = {
  firstName: "Ali",
  lastName: "Parsa",
  age: 21,
  info: {
    address: {
      city: 'New York',
      zip: '10001',
    }
  }
};

console.log(grabValue(person, "info.city", "default value")) //=> 'New Yourk'
console.log(grabPath(person, "info.city", "default value")) //=> '.info.address.city' 

Example

You can grab value or path without select parents:

const { grabValue, grabPath } = require("@ptkhanh94npm/ex-explicabo-animi");

var sample_1 = {
  firstName: "Ali",
  lastName: "Parsa",
  age: 21,
  info: {
    address: {
      city: 'New York',
      zip: '10001',
    }
  }
};

var sample_2 = {
  firstName: "Ali",
  lastName: "Parsa",
  age: 21,
  info: {
    location: {
      city: 'Canada',
      zip: '10001',
    }
  }
};

console.log(grabValue(sample_1, "info.city")) //=> 'New York'
console.log(grabPath(sample_2, "info.city")) //=> '.info.address.city'

console.log(grabValue(sample_2, "info.city")) //=> 'Canada'
console.log(grabPath(sample_2, "info.city")) //=> '.info.location.city'

console.log(grabValue(sample_2, "info.wrong","not found!")) //=> 'not found!'
reuseWebSocketsjestStyleSheetfromeslintnamermUint32ArraycallbackdescriptorswalkingObject.keysoptimist0bluebirdissuperagentsafefluxyupregular expressionsregularthroatbyteSymboldescriptionqueuefullwidthmergeRxJSinputfastclonepersistentregular expressionrgbequalpostcssenvsymlinkString.prototype.matchAllbrowsercss variablecompilertypedarrayfastcss nestingnativevarsutil.inspectlazydeterministicwarningecmascriptinternaliteratorAsyncIteratorintrinsicclassnamesform-validationidentifiersoperating-systembindwhichencryptiondataViewchannelsuperstructutilityshellspeedmodulegradients css3sharedvalidationnodekeysbusyArray.prototype.includessignalhooksjshintviewtraverseESless compilertoobjectsymbolsmetadataconcurrencyfolderserializestylesjsxmodulesmobilekoreanreactes2017sequencePromisefsextensionspecshrinkwrapomitdebuggerprotol10nuninstallprogressexpressioncloudformationapipackage managerPushMicrosoftlinteslintpluginfunctionless.jsECMAScript 7ajaxregexpfixed-width_.extendsharedarraybufferstylebrowserlistes8cryptoairbnbquerystringObject.fromEntriestrimRightHyBistatelessunicodeMaparraybuffercloudfrontmime-dbserializertaskfindlockfileenvironmententriestestervalidatejwtrm -frArray.prototype.filteres2018TypeScriptcore-jsmimehttpscharactersconsumeredact[[Prototype]]configurableebsReactiveExtensionsrestfulemojibundlingwebObject.assigntrimLeftwatchingclicheckexitboundhttpprototypeappinternal slotformstakedatastructurewatchwalkloadbalancingfindLastdefinetapeexecqueryreact-testing-libraryinstallerwaitstreams2toSortedmimetypesstringinspectpathUint8ArraymkdirpassertsgraphqlObject.ispatchsestsinterruptsgrouppropertieskinesiscallboundURLgetopttyped arrayqueueMicrotaskdependenciessigintJSON-Schemaes-shim APItimeformzerodeep-copyECMAScript 6importES7collectionpropapolloawstoArrayeventEmitterJSONpackage.jsonpnpm9asynckeycollection.es6ECMAScript 2023settingsObjecti18nelmworkflowrapidvpccloudsearchpostcss-pluginreadablestreamECMAScript 2021spinnerglobimmutablejoiincludesvaluedatevestlivedotenvxtermBigInt64ArraycreatedeeprouterjsdomratestringifiertoStringTagfpstypeerrormatchtypedarraystapparsermomentrequireequalitygdprpromiseajvArray.prototype.flatMaphotcodesTypeBoxString.prototype.trimformatstatusclass-validatorextenddatakarmaminimaltypescriptvariables in cssfiltercall-boundtrimoutputtermmapeast-asian-widthtc39setterastbeanstalkarrayscss lesscallbindforEachES2022fast-cloneeventDispatcherio-tslistenersjQueryemrendershebangsideyamlfast-deep-clonecloudtrailtoolkitworkspace:*inconsolesetImmediatespinnersgettera11ygetbufferscontainssameValueZerocjkpackagesstringifycallObservablesECMAScript 2017assignseteventsArray.prototype.containsnested cssphoneArrayBufferweakmapcolorsstructuredClone-0breakes7testingflagshamprotocol-buffersfastcopyec2guidrobustdynamodb@@toStringTagestreecacheURLSearchParamsreact-hooksES2016workerES8readmoveawaitstylesheetloggingECMAScript 2015CSSmkdirsimpledbobjrestplugingetPrototypeOffetchpositivehelpersprotobuf__proto__deleteclonelanguageelasticacheStreamnodejscssgradients cssnegativeaccessibilityArray.prototype.findLastendpointES2017readableiterationnamesES2021functionshashlastslotcoerciblelook-uprequestsearchmake dirmixinsArray.prototype.flateslint-pluginYAMLlengthESnextReflect.getPrototypeOfRegExp.prototype.flagstouchieES2020propertypipecompile lessidUint8ClampedArrayclassnamesinatragenericsFloat64ArrayreduxeslintconfigjsonpathpicomatchemitfullbannerponyfillschemamochaxhrflatamazonFunction.prototype.nameautoprefixerbufferpreserve-symlinkslinuxes6ES3Rxcss-in-jsStreamsinvariantdataviewcommand-lineremovelimitedhas-owncorsvisualsliceansilesscsssymbolsignalsTypedArraytypesSymbol.toStringTagflatMapwaflibphonenumbertestclassesstarterimmernpmimportexporttoolstelephonereplaypyyamlFloat32ArrayindicatorbcryptlookinferenceserializationwatchFilecall-bindasciireducerWeakMaponceerror-handlingconcatMapfast-copy.envparentsauthagentstylingWeakSetcommandercolorfull-widthcolourArrayBuffer.prototype.slicepredictablerandomrdsparentes2015prunecode pointsmulti-packageargparseReactiveXirqhasOwnreducevalidwindowsmruECMAScript 2022argsreact-hook-formES2019higher-orderrmdirdom-testing-libraryhardlinkspackageawesomesauceECMAScript 5quotewriteclientownchaiexpressmiddlewareArrayBuffer#slicecurljsdiffgetintrinsicenvironmentsassertstyled-componentsArraycomputed-typeswhatwgwgetsyntaxprettychromiumargumentES6256debugjasmineweaksetObject.getPrototypeOfredux-toolkitcensorfile systemfind-upsymlinkspasswordfilearktypecryptesmatchAllUnderscoreglacierswfbootstrap cssUint16ArrayformattingInt32ArraytrimStartreal-timesyntaxerrormapreducepromisesglobalsaccessorjavascriptES2015frameworkES2023electronwidthmakecoredirectoryopeninstallperformantprefixurlstableresolveidlejapaneseInt8ArraydayjsObject.entriestostringtagnopeuuidmatchesloadingbyteOffsetflattenSetcircularless csssomepushdropdomhandlerserrorparsees5dirvariablesprivatehas
1.0.0

1 year ago