trim-body
v0.0.4
Published
Trim parsed request body or any object that needs its strings trimmed in one go.
Downloads
131
Readme
trim-body
Trim parsed request body or any object with strings that needs trimming in one go.
Note: Modifies object in place.
Installation
npm install trim-body
Usage
var trimBody = require('trim-body');
var body = {
name: {
first: ' First ',
last: ' Last'
},
email: ' [email protected] '
};
trimBody(body);
// body === {
// name: {
// first: 'First',
// last: 'Last'
// },
//
// email: '[email protected]'
// }
Tests
npm install -g mocha
Then,
npm test
License
MIT