@beautiful-code/object-utils

0.2.1 • Public • Published

Object Utils

This is a simple, object utility library. This is intended to be used imported via Node.js (or a bundler like Webpack for client side).

Installation

Using NPM or Yarn

npm install '@beautiful-code/object-utils'
yard add '@beautiful-code/object-utils'

Usage

Basic Usage

const ObjectUtils = require('@beautiful-code/string-utils').ObjectUtils

let example = {
    key: 'value',
    key2: 'value2',
    key3: 'value3'
}

let swapped = ObjectUtils.swap(example)

console.log(swapped.value)  // key
console.log(swapped.value2) // key2
console.log(swapped.value3) // key3

let extended = ObjectUtils.extend(swapped, {
    extra: 'value4'
})

console.log(extended.value)  // key
console.log(extended.extra)  // value4

Readme

Keywords

none

Package Sidebar

Install

npm i @beautiful-code/object-utils

Weekly Downloads

9

Version

0.2.1

License

ISC

Unpacked Size

1.5 MB

Total Files

52

Last publish

Collaborators

  • mynamereallysux