normalize-space-x

4.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

Coverage Status

normalize-space-x

Trims and replaces sequences of whitespace characters by a single space.

module.exports(string)string

normalize-space-xstring

This method strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string. (ES2019)

Kind: static property of normalize-space-x
Returns: string - The normalized string.
Throws:

  • TypeError If string is null or undefined or not coercible.
Param Type Description
string string The string to be normalized.

Example

import normalizeSpace from 'normalize-space-x';
 
console.log(normalizeSpace(' \t\n\t\n\t\n') === 'a b'); // true

Package Sidebar

Install

npm i normalize-space-x

Weekly Downloads

6,124

Version

4.1.2

License

MIT

Unpacked Size

155 kB

Total Files

11

Last publish

Collaborators

  • xotic750