white-space-x

List of ECMAScript white space characters.

MIT 47 个版本
安装
npm install white-space-x
yarn add white-space-x
pnpm add white-space-x
bun add white-space-x
README

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

white-space-x

module.exports : string

List of ECMAScript white space characters.

Kind: Exported member Example

import whiteSpace from 'white-space-x';
whiteSpaces.list.foreach(function(item) {
  console.log(item.description, item.code, item.string);
});

const characters = [
  '\u0009',
  '\u000a',
  '\u000b',
  '\u000c',
  '\u000d',
  '\u0020',
  '\u00a0',
  '\u1680',
  '\u2000',
  '\u2001',
  '\u2002',
  '\u2003',
  '\u2004',
  '\u2005',
  '\u2006',
  '\u2007',
  '\u2008',
  '\u2009',
  '\u200a',
  '\u2028',
  '\u2029',
  '\u202f',
  '\u205f',
  '\u3000',
  '\ufeff',
];
const ws = characters.join('');
const re1 = new RegExp('^[' + whiteSpace + ']+$)');
console.log(re1.test(ws)); // true

white-space-x.list : Array.<CharRecord>

An array of the whitespace char codes, string, descriptions and language presence in the specifications.

Kind: static property of white-space-x

white-space-x.string2016 : string

A string of the ES5 to ES2016 whitespace characters.

Kind: static property of white-space-x Example

import {string2016 as whiteSpace2016} from 'white-space-x';
const characters = [
  '\u0009',
  '\u000a',
  '\u000b',
  '\u000c',
  '\u000d',
  '\u0020',
  '\u00a0',
  '\u1680',
  '\u180e',
  '\u2000',
  '\u2001',
  '\u2002',
  '\u2003',
  '\u2004',
  '\u2005',
  '\u2006',
  '\u2007',
  '\u2008',
  '\u2009',
  '\u200a',
  '\u2028',
  '\u2029',
  '\u202f',
  '\u205f',
  '\u3000',
  '\ufeff',
];
const ws = characters.join('');
const re1 = new RegExp('^[' + whiteSpace2016 + ']+$)');
console.log(re1.test(ws)); // true

white-space-x.string2017 : string

A string of the ES2017 to ES2018 whitespace characters.

Kind: static property of white-space-x

white-space-x~CharRecord : Object

A record of a white space character.

Kind: inner typedef of white-space-x
Properties

Name Type Description
code number The character code.
description string A description of the character.
es5 boolean Whether the spec lists this as a white space.
es2015 boolean Whether the spec lists this as a white space.
es2016 boolean Whether the spec lists this as a white space.
es2017 boolean Whether the spec lists this as a white space.
es2018 boolean Whether the spec lists this as a white space.
string string The character string.
版本列表
4.1.1 2019-08-28
4.1.0 2019-08-14
4.0.24 2019-07-31
4.0.23 2019-07-27
4.0.22 2019-07-27
4.0.21 2019-07-26
4.0.20 2019-07-25
4.0.19 2019-07-24
4.0.18 2019-07-24
4.0.17 2019-07-23
4.0.16 2019-07-22
4.0.15 2019-07-21
4.0.14 2019-07-21
4.0.13 2019-07-19
4.0.12 2019-07-18
4.0.11 2019-07-18
4.0.10 2019-07-17
4.0.9 2019-07-17
4.0.8 2019-07-17
4.0.7 2019-07-16
4.0.6 2019-07-16
4.0.5 2019-07-15
4.0.4 2019-07-14
4.0.3 2019-07-13
4.0.2 2019-07-12
4.0.1 2019-07-10
4.0.0 2019-07-10
3.0.1 2018-02-24
3.0.0 2017-10-16
2.0.3 2017-09-01
2.0.2 2017-08-10
2.0.1 2017-08-10
2.0.0 2017-07-12
1.2.0 2017-03-29
1.1.1 2017-03-27
1.1.0 2017-02-25
1.0.10 2016-02-15
1.0.9 2016-02-13
1.0.8 2016-02-03
1.0.7 2016-01-25
1.0.6 2016-01-25
1.0.5 2016-01-25
1.0.4 2016-01-20
1.0.3 2016-01-20
1.0.2 2016-01-12
1.0.1 2016-01-10
1.0.0 2016-01-07