object-toolkit
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

object-toolkit

A simple javascript object toolkit.

This package combines several common object-related utilities, and adds missing types.

Installation

yarn add object-toolkit
 
# or 
 
npm install --save object-toolkit

Usage

Operations

import { set, get, remove, merge } from "object-toolkit";
 
const obj = { name: "Sage" };
set(obj, "age", 20);
console.log(obj); //=> { name: "Sage", age: 20 }
 
const age = get(obj, "age");
console.log(age); //=> 20
 
remove(obj, name);
console.log(obj); //=> { age: 20 }
 
const obj1 = { a: 1, b: 4 };
const obj2 = { a: 4, c: 5 };
const merged = merge(obj1, obj2);
console.log(merged); //=> { a: 4, b: 4, c: 5 }

Loops

import { map, forEach, filter, omit } from "object-toolkit";

Assertion

import { isObject } from "object-toolkit";

Credits

  • Jon (https://github.com/jonschlinkert)
  • Josh (https://github.com/TehShrike/deepmerge)

Copyright. Segun Adebayo

Readme

Keywords

none

Package Sidebar

Install

npm i object-toolkit

Weekly Downloads

1

Version

1.3.0

License

MIT

Unpacked Size

16.7 kB

Total Files

11

Last publish

Collaborators

  • segunadebayo