This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -7,39 +7,17 @@ exports.shouldHighlight = shouldHighlight;
exports.getChalk = getChalk;
exports.default = highlight;
function _jsTokens() {
const data = _interopRequireWildcard(require("js-tokens"));
var _jsTokens = _interopRequireWildcard(require("js-tokens"));
_jsTokens = function () {
return data;
};
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
return data;
}
function _esutils() {
const data = _interopRequireDefault(require("esutils"));
_esutils = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
var _chalk = _interopRequireDefault(require("chalk"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function getDefs(chalk) {
return {
@@ -61,10 +39,10 @@ const BRACKET = /^[()[\]{}]$/;
function getTokenType(match) {
const [offset, text] = match.slice(-2);
const token = (0, _jsTokens().matchToToken)(match);
const token = (0, _jsTokens.matchToToken)(match);
if (token.type === "name") {
if (_esutils().default.keyword.isReservedWordES6(token.value)) {
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {
return "keyword";
}
@@ -89,7 +67,7 @@ function getTokenType(match) {
}
function highlightTokens(defs, text) {
return text.replace(_jsTokens().default, function (...args) {
return text.replace(_jsTokens.default, function (...args) {
const type = getTokenType(args);
const colorize = defs[type];
@@ -102,14 +80,14 @@ function highlightTokens(defs, text) {
}
function shouldHighlight(options) {
return _chalk().default.supportsColor || options.forceColor;
return _chalk.default.supportsColor || options.forceColor;
}
function getChalk(options) {
let chalk = _chalk().default;
let chalk = _chalk.default;
if (options.forceColor) {
chalk = new (_chalk().default.constructor)({
chalk = new _chalk.default.constructor({
enabled: true,
level: 1
});

View File

@@ -1,48 +1,47 @@
{
"_args": [
[
"@babel/highlight@7.5.0",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "@babel/highlight@7.5.0",
"_id": "@babel/highlight@7.5.0",
"_from": "@babel/highlight@^7.10.4",
"_id": "@babel/highlight@7.10.4",
"_inBundle": false,
"_integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
"_integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
"_location": "/@babel/highlight",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "@babel/highlight@7.5.0",
"raw": "@babel/highlight@^7.10.4",
"name": "@babel/highlight",
"escapedName": "@babel%2fhighlight",
"scope": "@babel",
"rawSpec": "7.5.0",
"rawSpec": "^7.10.4",
"saveSpec": null,
"fetchSpec": "7.5.0"
"fetchSpec": "^7.10.4"
},
"_requiredBy": [
"/@babel/code-frame"
],
"_resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
"_spec": "7.5.0",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
"_shasum": "7d1bdfd65753538fabe6c38596cdb76d9ac60143",
"_spec": "@babel/highlight@^7.10.4",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@babel/code-frame",
"author": {
"name": "suchipi",
"email": "me@suchipi.com"
},
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"bundleDependencies": false,
"dependencies": {
"@babel/helper-validator-identifier": "^7.10.4",
"chalk": "^2.0.0",
"esutils": "^2.0.2",
"js-tokens": "^4.0.0"
},
"deprecated": false,
"description": "Syntax highlight JavaScript strings for output in terminals.",
"devDependencies": {
"strip-ansi": "^4.0.0"
},
"gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4",
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
"homepage": "https://babeljs.io/",
"license": "MIT",
"main": "lib/index.js",
@@ -52,7 +51,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-highlight"
"url": "git+https://github.com/babel/babel.git",
"directory": "packages/babel-highlight"
},
"version": "7.5.0"
"version": "7.10.4"
}