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

Dependencies (0)

    Dev Dependencies (1)

    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