Socket
Book a DemoInstallSign in
Socket

@degjs/object-utils

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@degjs/object-utils

A utility library for working with JavaScript objects.

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
8
Created
Source

objectUtils

A utility library for working with JavaScript objects.

Install

Build Status

objectUtils is an ES6 module. Consequently, you'll need an ES6 transpiler (Babel is a nice one) as part of your Javascript workflow.

If you're already using NPM for your project, you can install objectUtils with the following command:

$ npm install @degjs/object-utils

Usage

Importing individual objectUtils methods:

import { ensureArray } from "@degjs/object-utils";

let guaranteedArray = ensureArray(possibleArray);

Importing all objectUtils methods:

import * as objectUtils from "@degjs/object-utils";

let guaranteedArray = objectUtils.ensureArray(possibleArray);

Methods

ensureArray(obj)

The ensureArray method returns a guaranteed array, regardless of the paramater passed into it.

obj

Type: Array or String
The potential array to test.

assignDeep(target, source)

The assignDeep method copies the values of a source object to a target object. Unlike Object.assign, assignDeep does a proper deep clone of nested objects.

target

Type: Object
The source object to copy.

source

Type: Object
The target object to copy to.

Browser Support

objectUtils depends on the following browser APIs:

To support legacy browsers, you'll need to include polyfills for the above APIs.

Keywords

objects

FAQs

Package last updated on 17 Sep 2018

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