3.1.2 • Published 5 years ago

is-surrogate-pair-x v3.1.2

Weekly downloads
250
License
MIT
Repository
github
Last release
5 years ago

is-surrogate-pair-x

Tests if 2 characters together are a surrogate pair.

module.exports(char1, [char2])boolean

Tests if the two character arguments combined are a valid UTF-16 surrogate pair.

Kind: Exported function
Returns: boolean - Returns true if the two characters create a valid 'UTF-16' surrogate pair; otherwise false.

ParamTypeDescription
char1*The character combination, or if char2 is supplied then the first character of a suspected surrogate pair.
char2*The second character of a suspected surrogate pair.

Example

import isSurrogatePair from 'is-surrogate-pair-x';

const test1 = 'a';
const test2 = '𠮟';

console.log(isSurrogatePair(test1)); // false
console.log(isSurrogatePair(test1.charAt(0), test1.charAt(1))); // false
console.log(isSurrogatePair(test2)); // true
console.log(isSurrogatePair(test2.charAt(0), test2.charAt(1))); // true
3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.23

5 years ago

3.0.22

5 years ago

3.0.21

5 years ago

3.0.20

5 years ago

3.0.19

5 years ago

3.0.18

5 years ago

3.0.17

5 years ago

3.0.16

5 years ago

3.0.15

5 years ago

3.0.14

5 years ago

3.0.13

5 years ago

3.0.12

5 years ago

3.0.11

5 years ago

3.0.10

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.12

8 years ago

1.0.11

8 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