props-transform
v1.0.1
Published
Transforms properties of an object by given transform functions.
Downloads
19
Maintainers
Readme
props-transform
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