4.1.1 • Published 5 years ago

white-space-x v4.1.1

Weekly downloads
14,354
License
MIT
Repository
github
Last release
5 years ago

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

NameTypeDescription
codenumberThe character code.
descriptionstringA description of the character.
es5booleanWhether the spec lists this as a white space.
es2015booleanWhether the spec lists this as a white space.
es2016booleanWhether the spec lists this as a white space.
es2017booleanWhether the spec lists this as a white space.
es2018booleanWhether the spec lists this as a white space.
stringstringThe character string.
4.1.1

5 years ago

4.1.0

5 years ago

4.0.24

5 years ago

4.0.23

5 years ago

4.0.22

5 years ago

4.0.21

5 years ago

4.0.20

5 years ago

4.0.19

5 years ago

4.0.18

5 years ago

4.0.17

5 years ago

4.0.16

5 years ago

4.0.15

5 years ago

4.0.14

5 years ago

4.0.13

5 years ago

4.0.12

5 years ago

4.0.11

5 years ago

4.0.10

5 years ago

4.0.9

5 years ago

4.0.8

5 years ago

4.0.7

5 years ago

4.0.6

5 years ago

4.0.5

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.1

6 years ago

3.0.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago