0.0.4 • Published 10 years ago

trim-body v0.0.4

Weekly downloads
29
License
MIT
Repository
github
Last release
10 years ago

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