1.0.6 • Published 5 years ago

transform-keys-ts v1.0.6

Weekly downloads
11
License
ISC
Repository
github
Last release
5 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

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago