props-transform

1.0.1 • Public • Published

props-transform Build Status

Transforms properties of an object by given transform functions.

Usage

import createTransform from 'props-transform';

const transform = createTransform()
    .add('count', (value) => parseInt(value, 10))
    .add('title', (value) => value.toUpperCase());

const obj = {
    count: '10';
    title: 'my title'
};

transform(obj);
// => { count: 10, title: 'MY TITLE' }

Installation

npm install --save props-transform

License

MIT

/props-transform/

    Package Sidebar

    Install

    npm i props-transform

    Weekly Downloads

    8

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • floriangosse