1.4.5 • Published 1 year ago

mitsuketa v1.4.5

Weekly downloads
11
License
ISC
Repository
github
Last release
1 year ago

Warning: mitsuketa project is no longer maintained in favor of @enio.ai/data-ferret.

Thanks for using this project. If you have concerns or need help with migration, you can leave a comment or question on enio's discussion board.

Mitsuketa Build Status

Installation

Using npm:

$ npm i -g npm
$ npm i --save mitsuketa

Why mitsuketa?

Mitsuketa makes JavaScript easier by taking the hassle out of working with deeply nested data structures. Allows you to strict compare object, locate deeply nested entities, etc.

Lastest Release Notes

  1. Two new features have been released. deepRemove_Key, deepRemoveAll_Key to remove the properties or keys of any simple or deeply nested object on the fly!
  2. Great News! As part of the effort to further improve documentation, next Monday, we are releasing a playground website. What you can do there is visualize data and interact with mitsuketa. To learn more of how we are achieving this, you can check out mitsuketa's sister project React JSON Editor.
  3. Up until recently, most of the features have focused on obtaining data from complex object trees. Now we are taking an exciting new focus on actual deeply nested object manipulation. Check out our project board for a sneak peek to the new features. Feel free suggest any feature that you'd like to see by answering the survey down below.
  4. If you haven't checked it out already, you can learn more about how we set up and execute tests.

Overview

MethodBrief DescriptionParameters/InputOutput
getTypeGets typeof identity also makes distinction between object, null, and arrayidentitystring
sameTypeCompares two identities using getType methodidentityA, identityBidentity or false
sameStructureCompares two identities using sameType then validates both have the same keysidentityA, identityBidentity or false
identicalCompares two identities using sameStructure then validates children or nested structures for iterble identities or actual valuesidentityA, identityBidentity or false
isIterableChecks if identity contains one or more keys or propertiesidentityboolean
containsKeysChecks if identity contains the specified propertiesidentity, keyListboolean
trimRemoves properties from identity and only keeps the specified propertiesidentity, keyListidentity
locatePerforms a deep search by iterating through the collection's entire object tree an returns the path to the first identical match that is found as a string of dot . separated property namescollection, identitystring
deepGetUses locate and returns the indentity's container if found in collectioncollection, identityidentity
locateAllUses locate and returns all the paths to all matchescollection, identityarray of string
deepFilterUses locateAll and returns an array of all an identites matched inside collectioncollection, identityarray of identities
lengthReturns the number of keys or properties contained in identityidentitynumber
existsPerforms deep search on collection for an identical match to identitycollection, identityboolean
onlyExistingFor each identity in identities, performs a deep search on collection using exists, to shorten the list identities to those that were foundcollection, identitiesidentities
onlyMissingFor each identity in identities, performs a deep search on collection using exists, to shorten the list identities to those that were not foundcollection, identitiesidentities
isFalsyChecks if identity has or false or false-like values. These include: null, undefined, '', false, and 0identityidentity or false
isTruthyChecks if identity is non-falsyidentityidentity or false
foundTruthyPerforms deep search on collection, and evaluate if isTruthy on the first identical match to identitycollection, identityboolean
foundFalsyPerforms deep search on collection, and evaluate if isFalsy on the first identical match to identitycollection, identityboolean
onlyTruthyFor each identity in identities, performs a deep search on collection using exists, and evaluates if isTruthy on the first identical match of property to shorten the list identities to those that were found and also truthycollection, identities, propertyidentities
onlyFalsyFor each identity in identities, performs a deep search on collection using exists, and evaluates if isFalsy on the first identical match of property to shorten the list identities to those that were found and also truthycollection, identities, propertyidentities
countMatchesPerforms deep search for identity on collection using locateAll and returns the number of confirmed matches in a given depthcollection, identity, numbernumber
maxDepthReturns the nth value of the deepest layer of the entire object treeidentitynumber
matchDepthPerforms deep search for identity on collection to return the location's depth of the first match. If no match found, returns false.collection, identitynumber
locate_KeyPerforms a deep search by iterating through the collection's entire object tree an returns the path to the first identical match that is found as a string of dot . separated property namescollection, keystring
deepGet_KeyUses locate_Key and returns the indentity's container if found in collectioncollection, keyidentity
locateAll_KeyUses locate_Key and returns all the paths to all matchescollection, keyarray of string
deepFilter_KeyUses locateAll and returns an array of all an identites matched inside collectioncollection, keyarray of identities
deepCloneCreates a non-reference clone that is an exact copy to the identity provided. Can be used to create shallow clones of specific depths. Can also be used to create branch clones. Read more in documentationcollection, keyany
renameKeyPerforms deep search on the identity's object tree to rename the first matching key.identity, key, keyidentity
renameKeysPerforms deep search on the identity's object tree to rename all matching keys.identity, key, keyidentity
deepRemove_KeyPerforms deep search on the identity's object tree to remove the first property with matching key.identity, keyidentity
deepRemoveAll_KeyPerforms deep search on the identity's object tree to remove all properties with matching key.identity, keyidentity

Built With

Authors

License

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

Acknowledgments

  • Got my inspiration from lodash.js

Help me improve!

If you have a minute to spare, can you answer these two questions? https://www.surveymonkey.com/r/XJ37XSP

1.4.5

1 year ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago