trim-body

0.0.4 • Public • Published

trim-body

Build Status

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: '  user@example.com  '
};
 
trimBody(body);
 
// body === {
//   name: {
//     first: 'First',
//     last: 'Last'
//   },
//
//   email: 'user@example.com'
// }

Tests

npm install -g mocha

Then,

npm test

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i trim-body

Weekly Downloads

14

Version

0.0.4

License

MIT

Last publish

Collaborators

  • samora