sc-pick
v0.0.1
Published
Pick specified keys from an object
Downloads
2
Keywords
Readme
TOC
pick(object:Object, keys:Array)
example.
var testObject = {
name: "David",
__privateProperty: "booya",
country: "Australia"
};
var newObject = pick( testObject, [ "name", "country" ] );
Object.keys( newObject ).should.have.lengthOf( 2 );
newObject.should.have.a.property( "name", testObject.name );
newObject.should.have.a.property( "country", testObject.country );
newObject.should.not.have.a.property( "__privateProperty" );