1.0.6 • Published 6 years ago

transform-keys-ts v1.0.6

Weekly downloads
11
License
ISC
Repository
github
Last release
6 years ago

transform-keys

Simple nodejs module for transforming plain object keys written in typescript

Install

npm install transform-keys-ts

Usage

import { capitalize, map, slice } from 'lodash';

import {
    transformKeys
} from 'transform-keys-ts';
// convert snake case to camel case
transformKeys((key) => {
            const parts = key.split('_');
            const allButFirst = map(slice(parts, 1), (str) => capitalize(str));
            return [parts[0], ...allButFirst].join('');
        }, subject);

browse test for shorthand methods

Build & Test

npm install

npm run build

npm run test

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago