@technobuddha/library
Version:
A large library of useful functions
20 lines (19 loc) • 725 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSurrogate = void 0;
/**
* Deterimine is a character is a surrogate
*
* @param input the character to test
* @param __namedParameters see {@link Options}
* @default high true
* @defaultValue low true
* @returns true if the specified character is a unicode surrogate
*/
function isSurrogate(input, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.high, high = _c === void 0 ? true : _c, _d = _b.low, low = _d === void 0 ? true : _d;
var cc = input.charCodeAt(0);
return ((high && cc >= 0xD800 && cc <= 0xDBFF) || (low && cc >= 0xDC00 && cc <= 0xDFFF));
}
exports.isSurrogate = isSurrogate;
exports.default = isSurrogate;