Necrotizing Pineapple Music
    Wondering what’s next for npm?Check out our public roadmap! »

    objectkeys-case
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published

    objectkeys-case

    Change the case (to upper or to lower) of the first char of object properties.

    Install

    yarn

    yarn add objectkeys-case

    npm

    npm install objectkeys-case

    Usage

    const { lowCaseKeys, upCaseKeys } = require("objectkeys-case");
     
    const data = {
        Foo: "foo",
        BAR: "BAR",
        Baz: {
            SUb1: "sub1",
            sUb2: "sub2",
        }
    };
     
    const lower = lowCaseKeys(data);
     
    /*
    lower
    {
        foo: "foo",
        bAR: "BAR",
        baz: {
            sUb1: "sub1",
            sUb2: "sub2"
        }
    }
    */
     
    const upper = upCaseKeys(data);
     
    /*
    upper
    {
        Foo: "foo",
        BAR: "BAR",
        Baz: {
            SUb1: "sub1",
            SUb2: "sub2"
        }
    }
    */
     

    Release notes

    1.2.0 - 2020-08-04

    • Now working with objects and arrays

    1.1.0 - 2020-07-19

    • Improved for null values

    1.0.0 - 2020-07-05

    • Initial release

    Install

    npm i objectkeys-case

    DownloadsWeekly Downloads

    5

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    5.23 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar