object-shift

0.0.2 • Public • Published

object-shift

renames object properties

Object.prototype.shift = require('../object-shift');

let my_object = {
  name: 'John',
  last: 'Doe'
};

console.log(Object.shift(my_object, {
  name: 'firstName'
  // May also rename property "last"
}));

/*  Returns:
 *  {
 *     firstName: 'John',
 *     last: 'Doe'
 *  }
 */

Readme

Keywords

none

Package Sidebar

Install

npm i object-shift

Weekly Downloads

6

Version

0.0.2

License

Apache-2.0

Last publish

Collaborators

  • stuft2