New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ultraq/object-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ultraq/object-utils

A collection of utilities for JavaScript objects

Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
9
-68.97%
Maintainers
1
Weekly downloads
 
Created
Source

object-utils

Build Status Coverage Status npm License

A collection of utilities for JavaScript objects.

Installation

npm install @ultraq/object-utils

API

equals(object1, object2)

Deep-equality comparison between 2 objects on whether they contain the same values as each other. Only works with objects that act as data structures, not classes or the like as this function only compares primitives using identity (===) comparison.

  • object1:
  • object2:

merge(target, ...sources)

Deep-merges all of the properties of the objects in sources with target, modifying the target object and returning it.

  • target: object to merge values into
  • sources: array of argument list of objects to copy values from

navigate(object, path)

Returns a value from an object via a path string that describes the nesting of objects to get to the value, eg:

let object = {
  greeting: {
    message: 'Hello!'
  }
};
let pathToMessage = 'greeting.message';

If the path doesn't resolve to anything, then undefined is returned.

  • object: object to search through
  • path: a dot-separated path string to get to the desired value within the object

Keywords

object

FAQs

Package last updated on 18 Mar 2019

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