Package Exports
- string-character-is-astral-surrogate
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (string-character-is-astral-surrogate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
string-character-is-astral-surrogate
Tells, is given character a part of astral character, specifically, a high and low surrogate
Install
npm i string-character-is-astral-surrogate
Quick Take
import { strict as assert } from "assert";
import {
isHighSurrogate,
isLowSurrogate,
} from "string-character-is-astral-surrogate";
// 🧢 = \uD83E\uDDE2
assert.equal(isHighSurrogate("\uD83E"), true);
// the first character, high surrogate of the cap is indeed a high surrogate
assert.equal(isHighSurrogate("\uDDE2"), false);
// the second character, low surrogate of the cap is NOT a high surrogate
assert.equal(isLowSurrogate("\uD83E"), false);
// the first character, high surrogate of the cap is NOT a low surrogate
// it's a high surrogate
assert.equal(isLowSurrogate("\uDDE2"), true);
// the second character, low surrogate of the cap is indeed a low surrogate
Documentation
Please visit codsen.com for a full description of the API and examples.
Contributing
To report bugs or request features or assistance, raise an issue on GitHub.
Licence
MIT License
Copyright (c) 2010-2021 Roy Revelt and other contributors