append-to-all-attributes

1.0.3 • Public • Published

append-to-all-attributes

Append a string to all keys of an object (handy utility)

Install

$ npm install append-to-all-attributes

Usage

const appendToAllAttributes = require('append-to-all-attributes');
appendToAllAttributes({
    sanFrancisco_to_newYork: 50,
    madrid_to_barcelona: 5,
    withChilds: {
        onlyOneLevel: "It will not apply to inner attributes"
    }
}, "__by_car");

//=>
{
    sanFrancisco_to_newYork__by_car: 50,
    madrid_to_barcelona__by_car: 5,
    withChilds__by_car: {
        onlyOneLevel: "It will not apply to inner attributes"
    }
}

License

MIT © Fabio Espinosa

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    2
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i append-to-all-attributes

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

2.89 kB

Total Files

4

Last publish

Collaborators

  • fabioespinosa