Skip to content

samora/trim-body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Trim parsed request body or any object that needs its strings trimmed in one go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published