trims
v0.1.1
Published
Trimming string whitespace from object, array or string
Downloads
161
Readme
trims
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