1.0.3 • Published 5 years ago

append-to-all-attributes v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago