Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mitsuketa

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mitsuketa

A Javascript library that enables you to handle deeply nested objects easily.

  • 1.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by140%
Maintainers
1
Weekly downloads
 
Created
Source

Mitsuketa Build Status



A Javascript library that enables you to handle deeply nested objects easily.

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.

Overview

MethodDescriptionParameters/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
deepFilterUsers 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

Built With

  • Vanilla Javascript, ES5, ES6

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

Keywords

FAQs

Package last updated on 14 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc