trims

0.1.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i trims

Weekly Downloads

89

Version

0.1.1

License

MIT

Last publish

Collaborators

  • qingwei.li