0.0.0 • Published 8 years ago

object-simple-keymapper v0.0.0

Weekly downloads
3
License
WTFPL
Repository
github
Last release
8 years ago

object-simple-keymapper

Very basic and dumb library to copy/modify keys from one object to the other.

Installation

$ npm install object-simple-keymapper

Usage

var a = {x:10, y:20, z:30};
var b = {};
KeyMapper.performMapping(a, b, {
  only: ["x","y"],
  remap: {
    y: "z"
  }
});

// b would now have x and z properties
console.log(b.x); // 10
console.log(b.z); // 30