obsops

0.1.5 • Public • Published

ObjectTools

A library for set and equality operations on objects.

Install

$ npm install obsops

Use

import * as obsops from 'obsops'
 
// a deep copy of object
let copy = obsops.copy(object);
 
// a frozen deep copy of object
let frozen = obsops.freezeCopy(object);
 
// a union of multiple objects
let union = obsops.union(...objects);
 
// an intersection of multiple objects, intersected by key
let isectKey = obsops.intersectionByKey(...objects);
 
// an intersection of multiple objects, intersected by value
let isectValue = obsops.instersectionByValue(...objects);
 
// the difference between multiple objects, resolved from right to left by key
let diffKey = obsops.differenceByKey(...objects);
 
// the difference between multiple objects, resolved from right to left by value
let diffValue = obsops.differenceByValue(...objects);

Package Sidebar

Install

npm i obsops

Weekly Downloads

0

Version

0.1.5

License

MIT

Last publish

Collaborators

  • chkt