Skip to content

ArthurLobopro/object-pick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

object-pick

Easy Pick object properties or clone objects.

How to use

import { pick, pickAllExcept, pickAll } from "@arthur-lobo/object-pick"

const obj = { foo: 11, bar: 22, foobar: 33 }

const onlyBar = pick(obj, ["bar"]) // Returns { bar: 22 }
const exceptBar = pickAllExcept(obj, ["bar"]) // Returns { foo: 11, foobar: 33 }
const clonedObj = pickAll(obj) // Returns a deep clone of obj.

About

Pick object properties or deep clone objects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published