picklock

0.6.1 • Public • Published

Picklock

The picklock practically for any situation 🙃 - collection of usefull tools

travis-web total downloads

Here you can read some documentation.

Installing

yarn add picklock --dev

or

npm i picklock -D

Usage example

import { addProperty, deleteProperty } from 'picklock';
 
const Snow = {
  name: 'John',
  age: 20,
  role: 'Bastard',
}
 
const Stark = deleteProperty(Snow, 'role');
 
console.log(Stark) // => { name: 'John', age: 20 }
console.log(Snow) // => { name: 'John', age: 20, role: 'Bastard' }
console.log(addProperty(Snow, 'father', 'Eddard')) // => { name: 'John', age: 20, role: 'Bastard', father: 'Eddard' }
console.log(addProperty(Snow, 'name', 'Ramsay')) // => Error: Property 'name' already exists in target Object!

Package Sidebar

Install

npm i picklock

Weekly Downloads

217

Version

0.6.1

License

MIT

Last publish

Collaborators

  • ivanzusko