0.1.1 • Published 8 years ago

trims v0.1.1

Weekly downloads
22
License
MIT
Repository
github
Last release
8 years ago

trims

Build Status Coverage Status npm

Trimming string whitespace from object, array or string.

Installation

npm i trims -S

Usage

import trims from 'trims'

trims('  abc  ') // => 'abc'
trims({ name: 'Tom  ',  age: 18 }) => // { name: 'Tom', age: 18 }
trims(['a ', ' b', ' c ']) // => ['a', 'b', 'c']
trims.left([' a', 'b ', ' c ']) // => ['a', 'b ', 'c ']
trims.right({ key: ' value ' }) // => { key: ' value' }

API

  • trims(any)
  • trims#left(any)
  • trims#right(any)

License

MIT