UNPKG

xast

Version:
42 lines 1.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isTrailingSurrogate = exports.isLeadingSurrogate = exports.isSupplementaryCodePoint = exports.isUnicodeScalarValue = exports.isNameContinue = exports.isNameStart = exports.isLetter = exports.isDigit = exports.isWhiteSpace = void 0; function isWhiteSpace(code) { return code === 0x0009 || code === 0x0020; } exports.isWhiteSpace = isWhiteSpace; function isDigit(code) { return code >= 0x0030 && code <= 0x0039; } exports.isDigit = isDigit; function isLetter(code) { return ((code >= 0x0061 && code <= 0x007a) || (code >= 0x0041 && code <= 0x005a)); } exports.isLetter = isLetter; function isNameStart(code) { return isLetter(code) || code === 0x005f; } exports.isNameStart = isNameStart; function isNameContinue(code) { return isLetter(code) || isDigit(code) || code === 0x005f; } exports.isNameContinue = isNameContinue; function isUnicodeScalarValue(code) { return ((code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)); } exports.isUnicodeScalarValue = isUnicodeScalarValue; function isSupplementaryCodePoint(body, location) { return (isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1))); } exports.isSupplementaryCodePoint = isSupplementaryCodePoint; function isLeadingSurrogate(code) { return code >= 0xd800 && code <= 0xdbff; } exports.isLeadingSurrogate = isLeadingSurrogate; function isTrailingSurrogate(code) { return code >= 0xdc00 && code <= 0xdfff; } exports.isTrailingSurrogate = isTrailingSurrogate; //# sourceMappingURL=characterClasses.js.map