picklock
v0.6.1
Published
The picklock practically for any situation - collection of usefull tools
Downloads
16
Maintainers
Readme
Picklock
The picklock practically for any situation 🙃 - collection of usefull tools
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!