mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2024-12-25 17:36:08 -07:00
58 lines
1.1 KiB
JavaScript
58 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isNewLine = isNewLine;
|
|
exports.isWhitespace = isWhitespace;
|
|
exports.skipWhiteSpace = exports.lineBreakG = exports.lineBreak = void 0;
|
|
const lineBreak = /\r\n?|[\n\u2028\u2029]/;
|
|
exports.lineBreak = lineBreak;
|
|
const lineBreakG = new RegExp(lineBreak.source, "g");
|
|
exports.lineBreakG = lineBreakG;
|
|
|
|
function isNewLine(code) {
|
|
switch (code) {
|
|
case 10:
|
|
case 13:
|
|
case 8232:
|
|
case 8233:
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
exports.skipWhiteSpace = skipWhiteSpace;
|
|
|
|
function isWhitespace(code) {
|
|
switch (code) {
|
|
case 0x0009:
|
|
case 0x000b:
|
|
case 0x000c:
|
|
case 32:
|
|
case 160:
|
|
case 5760:
|
|
case 0x2000:
|
|
case 0x2001:
|
|
case 0x2002:
|
|
case 0x2003:
|
|
case 0x2004:
|
|
case 0x2005:
|
|
case 0x2006:
|
|
case 0x2007:
|
|
case 0x2008:
|
|
case 0x2009:
|
|
case 0x200a:
|
|
case 0x202f:
|
|
case 0x205f:
|
|
case 0x3000:
|
|
case 0xfeff:
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
} |