node_modules/prettier/index.mjs in immosquare-cleaner-0.1.38 vs node_modules/prettier/index.mjs in immosquare-cleaner-0.1.39
- old
+ new
@@ -9,18 +9,23 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __typeError = (msg) => {
+ throw TypeError(msg);
+};
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
- if (typeof require !== "undefined")
- return require.apply(this, arguments);
+ if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
+var __esm = (fn, res) => function __init() {
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
+};
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
@@ -40,37 +45,550 @@
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
-var __publicField = (obj, key2, value) => {
- __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
- return value;
-};
-var __accessCheck = (obj, member, msg) => {
- if (!member.has(obj))
- throw TypeError("Cannot " + msg);
-};
-var __privateGet = (obj, member, getter) => {
- __accessCheck(obj, member, "read from private field");
- return getter ? getter.call(obj) : member.get(obj);
-};
-var __privateAdd = (obj, member, value) => {
- if (member.has(obj))
- throw TypeError("Cannot add the same private member more than once");
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
-};
-var __privateSet = (obj, member, value, setter) => {
- __accessCheck(obj, member, "write to private field");
- setter ? setter.call(obj, value) : member.set(obj, value);
- return value;
-};
-var __privateMethod = (obj, member, method) => {
- __accessCheck(obj, member, "access private method");
- return method;
-};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
+var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
+var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
+var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
+var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
+// node_modules/diff/lib/diff/base.js
+var require_base = __commonJS({
+ "node_modules/diff/lib/diff/base.js"(exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports["default"] = Diff;
+ function Diff() {
+ }
+ Diff.prototype = {
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ diff: function diff(oldString, newString) {
+ var _options$timeout;
+ var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
+ var callback = options8.callback;
+ if (typeof options8 === "function") {
+ callback = options8;
+ options8 = {};
+ }
+ this.options = options8;
+ var self = this;
+ function done(value) {
+ if (callback) {
+ setTimeout(function() {
+ callback(void 0, value);
+ }, 0);
+ return true;
+ } else {
+ return value;
+ }
+ }
+ oldString = this.castInput(oldString);
+ newString = this.castInput(newString);
+ oldString = this.removeEmpty(this.tokenize(oldString));
+ newString = this.removeEmpty(this.tokenize(newString));
+ var newLen = newString.length, oldLen = oldString.length;
+ var editLength = 1;
+ var maxEditLength = newLen + oldLen;
+ if (options8.maxEditLength) {
+ maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
+ }
+ var maxExecutionTime = (
+ /*istanbul ignore start*/
+ (_options$timeout = /*istanbul ignore end*/
+ options8.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity
+ );
+ var abortAfterTimestamp = Date.now() + maxExecutionTime;
+ var bestPath = [{
+ oldPos: -1,
+ lastComponent: void 0
+ }];
+ var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
+ if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+ return done([{
+ value: this.join(newString),
+ count: newString.length
+ }]);
+ }
+ var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
+ function execEditLength() {
+ for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
+ var basePath = (
+ /*istanbul ignore start*/
+ void 0
+ );
+ var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
+ if (removePath) {
+ bestPath[diagonalPath - 1] = void 0;
+ }
+ var canAdd = false;
+ if (addPath) {
+ var addPathNewPos = addPath.oldPos - diagonalPath;
+ canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
+ }
+ var canRemove = removePath && removePath.oldPos + 1 < oldLen;
+ if (!canAdd && !canRemove) {
+ bestPath[diagonalPath] = void 0;
+ continue;
+ }
+ if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
+ basePath = self.addToPath(addPath, true, void 0, 0);
+ } else {
+ basePath = self.addToPath(removePath, void 0, true, 1);
+ }
+ newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
+ if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+ return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
+ } else {
+ bestPath[diagonalPath] = basePath;
+ if (basePath.oldPos + 1 >= oldLen) {
+ maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
+ }
+ if (newPos + 1 >= newLen) {
+ minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
+ }
+ }
+ }
+ editLength++;
+ }
+ if (callback) {
+ (function exec() {
+ setTimeout(function() {
+ if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
+ return callback();
+ }
+ if (!execEditLength()) {
+ exec();
+ }
+ }, 0);
+ })();
+ } else {
+ while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
+ var ret = execEditLength();
+ if (ret) {
+ return ret;
+ }
+ }
+ }
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ addToPath: function addToPath(path13, added, removed, oldPosInc) {
+ var last = path13.lastComponent;
+ if (last && last.added === added && last.removed === removed) {
+ return {
+ oldPos: path13.oldPos + oldPosInc,
+ lastComponent: {
+ count: last.count + 1,
+ added,
+ removed,
+ previousComponent: last.previousComponent
+ }
+ };
+ } else {
+ return {
+ oldPos: path13.oldPos + oldPosInc,
+ lastComponent: {
+ count: 1,
+ added,
+ removed,
+ previousComponent: last
+ }
+ };
+ }
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
+ var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
+ newPos++;
+ oldPos++;
+ commonCount++;
+ }
+ if (commonCount) {
+ basePath.lastComponent = {
+ count: commonCount,
+ previousComponent: basePath.lastComponent
+ };
+ }
+ basePath.oldPos = oldPos;
+ return newPos;
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ equals: function equals(left, right) {
+ if (this.options.comparator) {
+ return this.options.comparator(left, right);
+ } else {
+ return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
+ }
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ removeEmpty: function removeEmpty(array2) {
+ var ret = [];
+ for (var i = 0; i < array2.length; i++) {
+ if (array2[i]) {
+ ret.push(array2[i]);
+ }
+ }
+ return ret;
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ castInput: function castInput(value) {
+ return value;
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ tokenize: function tokenize(value) {
+ return value.split("");
+ },
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ join: function join2(chars) {
+ return chars.join("");
+ }
+ };
+ function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
+ var components = [];
+ var nextComponent;
+ while (lastComponent) {
+ components.push(lastComponent);
+ nextComponent = lastComponent.previousComponent;
+ delete lastComponent.previousComponent;
+ lastComponent = nextComponent;
+ }
+ components.reverse();
+ var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
+ for (; componentPos < componentLen; componentPos++) {
+ var component = components[componentPos];
+ if (!component.removed) {
+ if (!component.added && useLongestToken) {
+ var value = newString.slice(newPos, newPos + component.count);
+ value = value.map(function(value2, i) {
+ var oldValue = oldString[oldPos + i];
+ return oldValue.length > value2.length ? oldValue : value2;
+ });
+ component.value = diff.join(value);
+ } else {
+ component.value = diff.join(newString.slice(newPos, newPos + component.count));
+ }
+ newPos += component.count;
+ if (!component.added) {
+ oldPos += component.count;
+ }
+ } else {
+ component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
+ oldPos += component.count;
+ if (componentPos && components[componentPos - 1].added) {
+ var tmp = components[componentPos - 1];
+ components[componentPos - 1] = components[componentPos];
+ components[componentPos] = tmp;
+ }
+ }
+ }
+ var finalComponent = components[componentLen - 1];
+ if (componentLen > 1 && typeof finalComponent.value === "string" && (finalComponent.added || finalComponent.removed) && diff.equals("", finalComponent.value)) {
+ components[componentLen - 2].value += finalComponent.value;
+ components.pop();
+ }
+ return components;
+ }
+ }
+});
+
+// node_modules/diff/lib/util/params.js
+var require_params = __commonJS({
+ "node_modules/diff/lib/util/params.js"(exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.generateOptions = generateOptions;
+ function generateOptions(options8, defaults) {
+ if (typeof options8 === "function") {
+ defaults.callback = options8;
+ } else if (options8) {
+ for (var name in options8) {
+ if (options8.hasOwnProperty(name)) {
+ defaults[name] = options8[name];
+ }
+ }
+ }
+ return defaults;
+ }
+ }
+});
+
+// node_modules/diff/lib/diff/line.js
+var require_line = __commonJS({
+ "node_modules/diff/lib/diff/line.js"(exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.diffLines = diffLines;
+ exports.diffTrimmedLines = diffTrimmedLines;
+ exports.lineDiff = void 0;
+ var _base = _interopRequireDefault(require_base());
+ var _params = require_params();
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { "default": obj };
+ }
+ var lineDiff = new /*istanbul ignore start*/
+ _base[
+ /*istanbul ignore start*/
+ "default"
+ /*istanbul ignore end*/
+ ]();
+ exports.lineDiff = lineDiff;
+ lineDiff.tokenize = function(value) {
+ if (this.options.stripTrailingCr) {
+ value = value.replace(/\r\n/g, "\n");
+ }
+ var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
+ if (!linesAndNewlines[linesAndNewlines.length - 1]) {
+ linesAndNewlines.pop();
+ }
+ for (var i = 0; i < linesAndNewlines.length; i++) {
+ var line3 = linesAndNewlines[i];
+ if (i % 2 && !this.options.newlineIsToken) {
+ retLines[retLines.length - 1] += line3;
+ } else {
+ if (this.options.ignoreWhitespace) {
+ line3 = line3.trim();
+ }
+ retLines.push(line3);
+ }
+ }
+ return retLines;
+ };
+ function diffLines(oldStr, newStr, callback) {
+ return lineDiff.diff(oldStr, newStr, callback);
+ }
+ function diffTrimmedLines(oldStr, newStr, callback) {
+ var options8 = (
+ /*istanbul ignore start*/
+ (0, /*istanbul ignore end*/
+ /*istanbul ignore start*/
+ _params.generateOptions)(callback, {
+ ignoreWhitespace: true
+ })
+ );
+ return lineDiff.diff(oldStr, newStr, options8);
+ }
+ }
+});
+
+// node_modules/diff/lib/patch/create.js
+var require_create = __commonJS({
+ "node_modules/diff/lib/patch/create.js"(exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.structuredPatch = structuredPatch;
+ exports.formatPatch = formatPatch;
+ exports.createTwoFilesPatch = createTwoFilesPatch2;
+ exports.createPatch = createPatch;
+ var _line = require_line();
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+ }
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
+ arr2[i] = arr[i];
+ }
+ return arr2;
+ }
+ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
+ if (!options8) {
+ options8 = {};
+ }
+ if (typeof options8.context === "undefined") {
+ options8.context = 4;
+ }
+ var diff = (
+ /*istanbul ignore start*/
+ (0, /*istanbul ignore end*/
+ /*istanbul ignore start*/
+ _line.diffLines)(oldStr, newStr, options8)
+ );
+ if (!diff) {
+ return;
+ }
+ diff.push({
+ value: "",
+ lines: []
+ });
+ function contextLines(lines) {
+ return lines.map(function(entry) {
+ return " " + entry;
+ });
+ }
+ var hunks = [];
+ var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
+ var _loop = function _loop2(i2) {
+ var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
+ current.lines = lines;
+ if (current.added || current.removed) {
+ var _curRange;
+ if (!oldRangeStart) {
+ var prev = diff[i2 - 1];
+ oldRangeStart = oldLine;
+ newRangeStart = newLine;
+ if (prev) {
+ curRange = options8.context > 0 ? contextLines(prev.lines.slice(-options8.context)) : [];
+ oldRangeStart -= curRange.length;
+ newRangeStart -= curRange.length;
+ }
+ }
+ (_curRange = /*istanbul ignore end*/
+ curRange).push.apply(
+ /*istanbul ignore start*/
+ _curRange,
+ /*istanbul ignore start*/
+ _toConsumableArray(
+ /*istanbul ignore end*/
+ lines.map(function(entry) {
+ return (current.added ? "+" : "-") + entry;
+ })
+ )
+ );
+ if (current.added) {
+ newLine += lines.length;
+ } else {
+ oldLine += lines.length;
+ }
+ } else {
+ if (oldRangeStart) {
+ if (lines.length <= options8.context * 2 && i2 < diff.length - 2) {
+ var _curRange2;
+ (_curRange2 = /*istanbul ignore end*/
+ curRange).push.apply(
+ /*istanbul ignore start*/
+ _curRange2,
+ /*istanbul ignore start*/
+ _toConsumableArray(
+ /*istanbul ignore end*/
+ contextLines(lines)
+ )
+ );
+ } else {
+ var _curRange3;
+ var contextSize = Math.min(lines.length, options8.context);
+ (_curRange3 = /*istanbul ignore end*/
+ curRange).push.apply(
+ /*istanbul ignore start*/
+ _curRange3,
+ /*istanbul ignore start*/
+ _toConsumableArray(
+ /*istanbul ignore end*/
+ contextLines(lines.slice(0, contextSize))
+ )
+ );
+ var hunk = {
+ oldStart: oldRangeStart,
+ oldLines: oldLine - oldRangeStart + contextSize,
+ newStart: newRangeStart,
+ newLines: newLine - newRangeStart + contextSize,
+ lines: curRange
+ };
+ if (i2 >= diff.length - 2 && lines.length <= options8.context) {
+ var oldEOFNewline = /\n$/.test(oldStr);
+ var newEOFNewline = /\n$/.test(newStr);
+ var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
+ if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
+ curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
+ }
+ if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
+ curRange.push("\\ No newline at end of file");
+ }
+ }
+ hunks.push(hunk);
+ oldRangeStart = 0;
+ newRangeStart = 0;
+ curRange = [];
+ }
+ }
+ oldLine += lines.length;
+ newLine += lines.length;
+ }
+ };
+ for (var i = 0; i < diff.length; i++) {
+ _loop(
+ /*istanbul ignore end*/
+ i
+ );
+ }
+ return {
+ oldFileName,
+ newFileName,
+ oldHeader,
+ newHeader,
+ hunks
+ };
+ }
+ function formatPatch(diff) {
+ if (Array.isArray(diff)) {
+ return diff.map(formatPatch).join("\n");
+ }
+ var ret = [];
+ if (diff.oldFileName == diff.newFileName) {
+ ret.push("Index: " + diff.oldFileName);
+ }
+ ret.push("===================================================================");
+ ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
+ ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
+ for (var i = 0; i < diff.hunks.length; i++) {
+ var hunk = diff.hunks[i];
+ if (hunk.oldLines === 0) {
+ hunk.oldStart -= 1;
+ }
+ if (hunk.newLines === 0) {
+ hunk.newStart -= 1;
+ }
+ ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
+ ret.push.apply(ret, hunk.lines);
+ }
+ return ret.join("\n") + "\n";
+ }
+ function createTwoFilesPatch2(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
+ return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8));
+ }
+ function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options8) {
+ return createTwoFilesPatch2(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options8);
+ }
+ }
+});
+
// node_modules/fast-glob/out/utils/array.js
var require_array = __commonJS({
"node_modules/fast-glob/out/utils/array.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -194,12 +712,11 @@
if (typeof str2 !== "string" || str2 === "") {
return false;
}
var match;
while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str2)) {
- if (match[2])
- return true;
+ if (match[2]) return true;
str2 = str2.slice(match.index + match[0].length);
}
return false;
};
}
@@ -378,41 +895,35 @@
}
return false;
};
exports.find = (node, type2) => node.nodes.find((node2) => node2.type === type2);
exports.exceedsLimit = (min, max, step = 1, limit) => {
- if (limit === false)
- return false;
- if (!exports.isInteger(min) || !exports.isInteger(max))
- return false;
+ if (limit === false) return false;
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
return (Number(max) - Number(min)) / Number(step) >= limit;
};
exports.escapeNode = (block, n = 0, type2) => {
- let node = block.nodes[n];
- if (!node)
- return;
+ const node = block.nodes[n];
+ if (!node) return;
if (type2 && node.type === type2 || node.type === "open" || node.type === "close") {
if (node.escaped !== true) {
node.value = "\\" + node.value;
node.escaped = true;
}
}
};
exports.encloseBrace = (node) => {
- if (node.type !== "brace")
- return false;
+ if (node.type !== "brace") return false;
if (node.commas >> 0 + node.ranges >> 0 === 0) {
node.invalid = true;
return true;
}
return false;
};
exports.isInvalidBrace = (block) => {
- if (block.type !== "brace")
- return false;
- if (block.invalid === true || block.dollar)
- return true;
+ if (block.type !== "brace") return false;
+ if (block.invalid === true || block.dollar) return true;
if (block.commas >> 0 + block.ranges >> 0 === 0) {
block.invalid = true;
return true;
}
if (block.open !== true || block.close !== true) {
@@ -426,22 +937,26 @@
return true;
}
return node.open === true || node.close === true;
};
exports.reduce = (nodes) => nodes.reduce((acc, node) => {
- if (node.type === "text")
- acc.push(node.value);
- if (node.type === "range")
- node.type = "text";
+ if (node.type === "text") acc.push(node.value);
+ if (node.type === "range") node.type = "text";
return acc;
}, []);
exports.flatten = (...args) => {
const result = [];
const flat = (arr) => {
for (let i = 0; i < arr.length; i++) {
- let ele = arr[i];
- Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
+ const ele = arr[i];
+ if (Array.isArray(ele)) {
+ flat(ele);
+ continue;
+ }
+ if (ele !== void 0) {
+ result.push(ele);
+ }
}
return result;
};
flat(args);
return result;
@@ -453,13 +968,13 @@
var require_stringify = __commonJS({
"node_modules/braces/lib/stringify.js"(exports, module) {
"use strict";
var utils = require_utils();
module.exports = (ast, options8 = {}) => {
- let stringify = (node, parent = {}) => {
- let invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options8.escapeInvalid === true;
+ const stringify = (node, parent = {}) => {
+ const invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent);
+ const invalidNode = node.invalid === true && options8.escapeInvalid === true;
let output = "";
if (node.value) {
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
return "\\" + node.value;
}
@@ -467,11 +982,11 @@
}
if (node.value) {
return node.value;
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += stringify(child);
}
}
return output;
};
@@ -653,12 +1168,11 @@
}
return result;
}
function zip(a, b) {
let arr = [];
- for (let i = 0; i < a.length; i++)
- arr.push([a[i], b[i]]);
+ for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
return arr;
}
function compare(a, b) {
return a > b ? 1 : b > a ? -1 : 0;
}
@@ -723,16 +1237,13 @@
};
var isNumber = (num) => Number.isInteger(+num);
var zeros = (input) => {
let value = `${input}`;
let index = -1;
- if (value[0] === "-")
- value = value.slice(1);
- if (value === "0")
- return false;
- while (value[++index] === "0")
- ;
+ if (value[0] === "-") value = value.slice(1);
+ if (value === "0") return false;
+ while (value[++index] === "0") ;
return index > 0;
};
var stringify = (start, end, options8) => {
if (typeof start === "string" || typeof end === "string") {
return true;
@@ -740,12 +1251,11 @@
return options8.stringify === true;
};
var pad = (input, maxLength, toNumber) => {
if (maxLength > 0) {
let dash = input[0] === "-" ? "-" : "";
- if (dash)
- input = input.slice(1);
+ if (dash) input = input.slice(1);
input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
}
if (toNumber === false) {
return String(input);
}
@@ -755,26 +1265,25 @@
let negative = input[0] === "-" ? "-" : "";
if (negative) {
input = input.slice(1);
maxLength--;
}
- while (input.length < maxLength)
- input = "0" + input;
+ while (input.length < maxLength) input = "0" + input;
return negative ? "-" + input : input;
};
- var toSequence = (parts, options8) => {
+ var toSequence = (parts, options8, maxLen) => {
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
let prefix = options8.capture ? "" : "?:";
let positives = "";
let negatives = "";
let result;
if (parts.positives.length) {
- positives = parts.positives.join("|");
+ positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
}
if (parts.negatives.length) {
- negatives = `-(${prefix}${parts.negatives.join("|")})`;
+ negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
}
if (positives && negatives) {
result = `${positives}|${negatives}`;
} else {
result = positives || negatives;
@@ -787,12 +1296,11 @@
var toRange = (a, b, isNumbers, options8) => {
if (isNumbers) {
return toRegexRange(a, b, { wrap: false, ...options8 });
}
let start = String.fromCharCode(a);
- if (a === b)
- return start;
+ if (a === b) return start;
let stop = String.fromCharCode(b);
return `[${start}-${stop}]`;
};
var toRegex = (start, end, options8) => {
if (Array.isArray(start)) {
@@ -804,12 +1312,11 @@
};
var rangeError = (...args) => {
return new RangeError("Invalid range arguments: " + util2.inspect(...args));
};
var invalidRange = (start, end, options8) => {
- if (options8.strictRanges === true)
- throw rangeError([start, end]);
+ if (options8.strictRanges === true) throw rangeError([start, end]);
return [];
};
var invalidStep = (step, options8) => {
if (options8.strictRanges === true) {
throw new TypeError(`Expected step "${step}" to be a number`);
@@ -818,18 +1325,15 @@
};
var fillNumbers = (start, end, step = 1, options8 = {}) => {
let a = Number(start);
let b = Number(end);
if (!Number.isInteger(a) || !Number.isInteger(b)) {
- if (options8.strictRanges === true)
- throw rangeError([start, end]);
+ if (options8.strictRanges === true) throw rangeError([start, end]);
return [];
}
- if (a === 0)
- a = 0;
- if (b === 0)
- b = 0;
+ if (a === 0) a = 0;
+ if (b === 0) b = 0;
let descending = a > b;
let startString = String(start);
let endString = String(end);
let stepString = String(step);
step = Math.max(Math.abs(step), 1);
@@ -852,11 +1356,11 @@
}
a = descending ? a - step : a + step;
index++;
}
if (options8.toRegex === true) {
- return step > 1 ? toSequence(parts, options8) : toRegex(range, null, { wrap: false, ...options8 });
+ return step > 1 ? toSequence(parts, options8, maxLen) : toRegex(range, null, { wrap: false, ...options8 });
}
return range;
};
var fillLetters = (start, end, step = 1, options8 = {}) => {
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
@@ -895,16 +1399,14 @@
}
if (isObject3(step)) {
return fill2(start, end, 0, step);
}
let opts = { ...options8 };
- if (opts.capture === true)
- opts.wrap = true;
+ if (opts.capture === true) opts.wrap = true;
step = step || opts.step || 1;
if (!isNumber(step)) {
- if (step != null && !isObject3(step))
- return invalidStep(step, opts);
+ if (step != null && !isObject3(step)) return invalidStep(step, opts);
return fill2(start, end, 1, step);
}
if (isNumber(start) && isNumber(end)) {
return fillNumbers(start, end, step, opts);
}
@@ -919,20 +1421,21 @@
"node_modules/braces/lib/compile.js"(exports, module) {
"use strict";
var fill2 = require_fill_range();
var utils = require_utils();
var compile = (ast, options8 = {}) => {
- let walk = (node, parent = {}) => {
- let invalidBlock = utils.isInvalidBrace(parent);
- let invalidNode = node.invalid === true && options8.escapeInvalid === true;
- let invalid = invalidBlock === true || invalidNode === true;
- let prefix = options8.escapeInvalid === true ? "\\" : "";
+ const walk = (node, parent = {}) => {
+ const invalidBlock = utils.isInvalidBrace(parent);
+ const invalidNode = node.invalid === true && options8.escapeInvalid === true;
+ const invalid = invalidBlock === true || invalidNode === true;
+ const prefix = options8.escapeInvalid === true ? "\\" : "";
let output = "";
if (node.isOpen === true) {
return prefix + node.value;
}
if (node.isClose === true) {
+ console.log("node.isClose", prefix, node.value);
return prefix + node.value;
}
if (node.type === "open") {
return invalid ? prefix + node.value : "(";
}
@@ -944,18 +1447,18 @@
}
if (node.value) {
return node.value;
}
if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
- let range = fill2(...args, { ...options8, wrap: false, toRegex: true });
+ const args = utils.reduce(node.nodes);
+ const range = fill2(...args, { ...options8, wrap: false, toRegex: true, strictZeros: true });
if (range.length !== 0) {
return args.length > 1 && range.length > 1 ? `(${range})` : range;
}
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += walk(child, node);
}
}
return output;
};
@@ -971,36 +1474,34 @@
"use strict";
var fill2 = require_fill_range();
var stringify = require_stringify();
var utils = require_utils();
var append = (queue = "", stash = "", enclose = false) => {
- let result = [];
+ const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
- if (!stash.length)
- return queue;
+ if (!stash.length) return queue;
if (!queue.length) {
return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
}
- for (let item of queue) {
+ for (const item of queue) {
if (Array.isArray(item)) {
- for (let value of item) {
+ for (const value of item) {
result.push(append(value, stash, enclose));
}
} else {
for (let ele of stash) {
- if (enclose === true && typeof ele === "string")
- ele = `{${ele}}`;
+ if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
}
}
}
return utils.flatten(result);
};
var expand = (ast, options8 = {}) => {
- let rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
- let walk = (node, parent = {}) => {
+ const rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
+ const walk = (node, parent = {}) => {
node.queue = [];
let p = parent;
let q = parent.queue;
while (p.type !== "brace" && p.type !== "root" && p.parent) {
p = p.parent;
@@ -1013,11 +1514,11 @@
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
q.push(append(q.pop(), ["{}"]));
return;
}
if (node.nodes && node.ranges > 0) {
- let args = utils.reduce(node.nodes);
+ const args = utils.reduce(node.nodes);
if (utils.exceedsLimit(...args, options8.step, rangeLimit)) {
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
}
let range = fill2(...args, options8);
if (range.length === 0) {
@@ -1025,22 +1526,21 @@
}
q.push(append(q.pop(), range));
node.nodes = [];
return;
}
- let enclose = utils.encloseBrace(node);
+ const enclose = utils.encloseBrace(node);
let queue = node.queue;
let block = node;
while (block.type !== "brace" && block.type !== "root" && block.parent) {
block = block.parent;
queue = block.queue;
}
for (let i = 0; i < node.nodes.length; i++) {
- let child = node.nodes[i];
+ const child = node.nodes[i];
if (child.type === "comma" && node.type === "brace") {
- if (i === 1)
- queue.push("");
+ if (i === 1) queue.push("");
queue.push("");
continue;
}
if (child.type === "close") {
q.push(append(q.pop(), queue, enclose));
@@ -1065,11 +1565,11 @@
// node_modules/braces/lib/constants.js
var require_constants = __commonJS({
"node_modules/braces/lib/constants.js"(exports, module) {
"use strict";
module.exports = {
- MAX_LENGTH: 1024 * 64,
+ MAX_LENGTH: 1e4,
// Digits
CHAR_0: "0",
/* 0 */
CHAR_9: "9",
/* 9 */
@@ -1199,25 +1699,24 @@
} = require_constants();
var parse6 = (input, options8 = {}) => {
if (typeof input !== "string") {
throw new TypeError("Expected a string");
}
- let opts = options8 || {};
- let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ const opts = options8 || {};
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
if (input.length > max) {
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
}
- let ast = { type: "root", input, nodes: [] };
- let stack2 = [ast];
+ const ast = { type: "root", input, nodes: [] };
+ const stack2 = [ast];
let block = ast;
let prev = ast;
let brackets = 0;
- let length = input.length;
+ const length = input.length;
let index = 0;
let depth = 0;
let value;
- let memo = {};
const advance = () => input[index++];
const push2 = (node) => {
if (node.type === "text" && prev.type === "dot") {
prev.type = "text";
}
@@ -1246,11 +1745,10 @@
push2({ type: "text", value: "\\" + value });
continue;
}
if (value === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
- let closed = true;
let next;
while (index < length && (next = advance())) {
value += next;
if (next === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
@@ -1285,34 +1783,33 @@
push2({ type: "text", value });
block = stack2[stack2.length - 1];
continue;
}
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
- let open = value;
+ const open = value;
let next;
if (options8.keepQuotes !== true) {
value = "";
}
while (index < length && (next = advance())) {
if (next === CHAR_BACKSLASH) {
value += next + advance();
continue;
}
if (next === open) {
- if (options8.keepQuotes === true)
- value += next;
+ if (options8.keepQuotes === true) value += next;
break;
}
value += next;
}
push2({ type: "text", value });
continue;
}
if (value === CHAR_LEFT_CURLY_BRACE) {
depth++;
- let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
- let brace = {
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
+ const brace = {
type: "brace",
open: true,
close: false,
dollar,
depth,
@@ -1328,30 +1825,30 @@
if (value === CHAR_RIGHT_CURLY_BRACE) {
if (block.type !== "brace") {
push2({ type: "text", value });
continue;
}
- let type2 = "close";
+ const type2 = "close";
block = stack2.pop();
block.close = true;
push2({ type: type2, value });
depth--;
block = stack2[stack2.length - 1];
continue;
}
if (value === CHAR_COMMA && depth > 0) {
if (block.ranges > 0) {
block.ranges = 0;
- let open = block.nodes.shift();
+ const open = block.nodes.shift();
block.nodes = [open, { type: "text", value: stringify(block) }];
}
push2({ type: "comma", value });
block.commas++;
continue;
}
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
- let siblings = block.nodes;
+ const siblings = block.nodes;
if (depth === 0 || siblings.length === 0) {
push2({ type: "text", value });
continue;
}
if (prev.type === "dot") {
@@ -1368,11 +1865,11 @@
block.args = [];
continue;
}
if (prev.type === "range") {
siblings.pop();
- let before = siblings[siblings.length - 1];
+ const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
continue;
}
@@ -1384,21 +1881,18 @@
do {
block = stack2.pop();
if (block.type !== "root") {
block.nodes.forEach((node) => {
if (!node.nodes) {
- if (node.type === "open")
- node.isOpen = true;
- if (node.type === "close")
- node.isClose = true;
- if (!node.nodes)
- node.type = "text";
+ if (node.type === "open") node.isOpen = true;
+ if (node.type === "close") node.isClose = true;
+ if (!node.nodes) node.type = "text";
node.invalid = true;
}
});
- let parent = stack2[stack2.length - 1];
- let index2 = parent.nodes.indexOf(block);
+ const parent = stack2[stack2.length - 1];
+ const index2 = parent.nodes.indexOf(block);
parent.nodes.splice(index2, 1, ...block.nodes);
}
} while (stack2.length > 0);
push2({ type: "eos" });
return ast;
@@ -1416,12 +1910,12 @@
var expand = require_expand();
var parse6 = require_parse();
var braces = (input, options8 = {}) => {
let output = [];
if (Array.isArray(input)) {
- for (let pattern of input) {
- let result = braces.create(pattern, options8);
+ for (const pattern of input) {
+ const result = braces.create(pattern, options8);
if (Array.isArray(result)) {
output.push(...result);
} else {
output.push(result);
}
@@ -1702,14 +2196,12 @@
}
return win32 === true || path13.sep === "\\";
};
exports.escapeLast = (input, char, lastIdx) => {
const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1)
- return input;
- if (input[idx - 1] === "\\")
- return exports.escapeLast(input, char, idx - 1);
+ if (idx === -1) return input;
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
};
exports.removePrefix = (input, state = {}) => {
let output = input;
if (output.startsWith("./")) {
@@ -1864,12 +2356,11 @@
}
if (code === CHAR_FORWARD_SLASH) {
slashes.push(index);
tokens.push(token2);
token2 = { value: "", depth: 0, isGlob: false };
- if (finished === true)
- continue;
+ if (finished === true) continue;
if (prev === CHAR_DOT && index === start + 1) {
start += 2;
continue;
}
lastIndex = index + 1;
@@ -1901,12 +2392,11 @@
}
break;
}
}
if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK)
- isGlobstar = token2.isGlobstar = true;
+ if (prev === CHAR_ASTERISK) isGlobstar = token2.isGlobstar = true;
isGlob = token2.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
@@ -1995,12 +2485,11 @@
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
base = base.slice(0, -1);
}
}
if (opts.unescape === true) {
- if (glob)
- glob = utils.removeBackslashes(glob);
+ if (glob) glob = utils.removeBackslashes(glob);
if (base && backslashes === true) {
base = utils.removeBackslashes(base);
}
}
const state = {
@@ -2206,12 +2695,11 @@
}
}
if (extglobs.length && tok.type !== "paren") {
extglobs[extglobs.length - 1].inner += tok.value;
}
- if (tok.value || tok.output)
- append(tok);
+ if (tok.value || tok.output) append(tok);
if (prev && prev.type === "text" && tok.type === "text") {
prev.value += tok.value;
prev.output = (prev.output || "") + tok.value;
return;
}
@@ -2522,12 +3010,11 @@
push2({ type: "slash", value, output: SLASH_LITERAL });
continue;
}
if (value === ".") {
if (state.braces > 0 && prev.type === "dot") {
- if (prev.value === ".")
- prev.output = DOT_LITERAL;
+ if (prev.value === ".") prev.output = DOT_LITERAL;
const brace = braces[braces.length - 1];
prev.type = "dots";
prev.output += value;
prev.value += value;
brace.dots = true;
@@ -2738,24 +3225,21 @@
}
}
push2(token2);
}
while (state.brackets > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError2("closing", "]"));
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]"));
state.output = utils.escapeLast(state.output, "[");
decrement("brackets");
}
while (state.parens > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError2("closing", ")"));
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")"));
state.output = utils.escapeLast(state.output, "(");
decrement("parens");
}
while (state.braces > 0) {
- if (opts.strictBrackets === true)
- throw new SyntaxError(syntaxError2("closing", "}"));
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}"));
state.output = utils.escapeLast(state.output, "{");
decrement("braces");
}
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
@@ -2798,12 +3282,11 @@
let star = opts.bash === true ? ".*?" : STAR;
if (opts.capture) {
star = `(${star})`;
}
const globstar = (opts2) => {
- if (opts2.noglobstar === true)
- return star;
+ if (opts2.noglobstar === true) return star;
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
};
const create = (str2) => {
switch (str2) {
case "*":
@@ -2822,15 +3305,13 @@
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
case "**/.*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
default: {
const match = /^(.*?)\.(\w+)$/.exec(str2);
- if (!match)
- return;
+ if (!match) return;
const source3 = create(match[1]);
- if (!source3)
- return;
+ if (!source3) return;
return source3 + DOT_LITERAL + match[2];
}
}
};
const output = utils.removePrefix(input, state);
@@ -2858,12 +3339,11 @@
if (Array.isArray(glob)) {
const fns = glob.map((input) => picomatch(input, options8, returnState));
const arrayMatcher = (str2) => {
for (const isMatch of fns) {
const state2 = isMatch(str2);
- if (state2)
- return state2;
+ if (state2) return state2;
}
return false;
};
return arrayMatcher;
}
@@ -2936,12 +3416,11 @@
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
return regex.test(path13.basename(input));
};
picomatch.isMatch = (str2, patterns, options8) => picomatch(patterns, options8)(str2);
picomatch.parse = (pattern, options8) => {
- if (Array.isArray(pattern))
- return pattern.map((p) => picomatch.parse(p, options8));
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options8));
return parse6(pattern, { ...options8, fastpaths: false });
};
picomatch.scan = (input, options8) => scan(input, options8);
picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
if (returnOutput === true) {
@@ -2976,12 +3455,11 @@
picomatch.toRegex = (source2, options8) => {
try {
const opts = options8 || {};
return new RegExp(source2, opts.flags || (opts.nocase ? "i" : ""));
} catch (err) {
- if (options8 && options8.debug === true)
- throw err;
+ if (options8 && options8.debug === true) throw err;
return /$^/;
}
};
picomatch.constants = constants;
module.exports = picomatch;
@@ -3019,17 +3497,15 @@
}
};
for (let i = 0; i < patterns.length; i++) {
let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true);
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
- if (negated)
- negatives++;
+ if (negated) negatives++;
for (let item of list) {
let matched = isMatch(item, true);
let match = negated ? !matched.isMatch : matched.isMatch;
- if (!match)
- continue;
+ if (!match) continue;
if (negated) {
omit2.add(matched.output);
} else {
omit2.delete(matched.output);
keep.add(matched.output);
@@ -3055,12 +3531,11 @@
micromatch2.not = (list, patterns, options8 = {}) => {
patterns = [].concat(patterns).map(String);
let result = /* @__PURE__ */ new Set();
let items = [];
let onResult = (state) => {
- if (options8.onResult)
- options8.onResult(state);
+ if (options8.onResult) options8.onResult(state);
items.push(state.output);
};
let matches = new Set(micromatch2(list, patterns, { ...options8, onResult }));
for (let item of items) {
if (!matches.has(item)) {
@@ -3090,12 +3565,11 @@
if (!utils.isObject(obj)) {
throw new TypeError("Expected the first argument to be an object");
}
let keys = micromatch2(Object.keys(obj), patterns, options8);
let res = {};
- for (let key2 of keys)
- res[key2] = obj[key2];
+ for (let key2 of keys) res[key2] = obj[key2];
return res;
};
micromatch2.some = (list, patterns, options8) => {
let items = [].concat(list);
for (let pattern of [].concat(patterns)) {
@@ -3140,20 +3614,18 @@
}
}
return res;
};
micromatch2.braces = (pattern, options8) => {
- if (typeof pattern !== "string")
- throw new TypeError("Expected a string");
+ if (typeof pattern !== "string") throw new TypeError("Expected a string");
if (options8 && options8.nobrace === true || !/\{.*\}/.test(pattern)) {
return [pattern];
}
return braces(pattern, options8);
};
micromatch2.braceExpand = (pattern, options8) => {
- if (typeof pattern !== "string")
- throw new TypeError("Expected a string");
+ if (typeof pattern !== "string") throw new TypeError("Expected a string");
return micromatch2.braces(pattern, { ...options8, expand: true });
};
module.exports = micromatch2;
}
});
@@ -3757,18 +4229,15 @@
results = {};
pending = keys.length;
}
function done(err) {
function end() {
- if (cb)
- cb(err, results);
+ if (cb) cb(err, results);
cb = null;
}
- if (isSync)
- queueMicrotask2(end);
- else
- end();
+ if (isSync) queueMicrotask2(end);
+ else end();
}
function each(i, err, result) {
results[i] = result;
if (--pending === 0 || err) {
done(err);
@@ -4214,12 +4683,11 @@
current = current.next;
}
return tasks;
}
function resume() {
- if (!self.paused)
- return;
+ if (!self.paused) return;
self.paused = false;
for (var i = 0; i < self.concurrency; i++) {
_running++;
release();
}
@@ -5541,10 +6009,542 @@
}
module.exports = FastGlob;
}
});
+// node_modules/chalk/source/vendor/ansi-styles/index.js
+function assembleStyles() {
+ const codes2 = /* @__PURE__ */ new Map();
+ for (const [groupName, group] of Object.entries(styles)) {
+ for (const [styleName, style] of Object.entries(group)) {
+ styles[styleName] = {
+ open: `\x1B[${style[0]}m`,
+ close: `\x1B[${style[1]}m`
+ };
+ group[styleName] = styles[styleName];
+ codes2.set(style[0], style[1]);
+ }
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+ }
+ Object.defineProperty(styles, "codes", {
+ value: codes2,
+ enumerable: false
+ });
+ styles.color.close = "\x1B[39m";
+ styles.bgColor.close = "\x1B[49m";
+ styles.color.ansi = wrapAnsi16();
+ styles.color.ansi256 = wrapAnsi256();
+ styles.color.ansi16m = wrapAnsi16m();
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
+ Object.defineProperties(styles, {
+ rgbToAnsi256: {
+ value(red, green, blue) {
+ if (red === green && green === blue) {
+ if (red < 8) {
+ return 16;
+ }
+ if (red > 248) {
+ return 231;
+ }
+ return Math.round((red - 8) / 247 * 24) + 232;
+ }
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
+ },
+ enumerable: false
+ },
+ hexToRgb: {
+ value(hex) {
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
+ if (!matches) {
+ return [0, 0, 0];
+ }
+ let [colorString] = matches;
+ if (colorString.length === 3) {
+ colorString = [...colorString].map((character) => character + character).join("");
+ }
+ const integer = Number.parseInt(colorString, 16);
+ return [
+ /* eslint-disable no-bitwise */
+ integer >> 16 & 255,
+ integer >> 8 & 255,
+ integer & 255
+ /* eslint-enable no-bitwise */
+ ];
+ },
+ enumerable: false
+ },
+ hexToAnsi256: {
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
+ enumerable: false
+ },
+ ansi256ToAnsi: {
+ value(code) {
+ if (code < 8) {
+ return 30 + code;
+ }
+ if (code < 16) {
+ return 90 + (code - 8);
+ }
+ let red;
+ let green;
+ let blue;
+ if (code >= 232) {
+ red = ((code - 232) * 10 + 8) / 255;
+ green = red;
+ blue = red;
+ } else {
+ code -= 16;
+ const remainder = code % 36;
+ red = Math.floor(code / 36) / 5;
+ green = Math.floor(remainder / 6) / 5;
+ blue = remainder % 6 / 5;
+ }
+ const value = Math.max(red, green, blue) * 2;
+ if (value === 0) {
+ return 30;
+ }
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
+ if (value === 2) {
+ result += 60;
+ }
+ return result;
+ },
+ enumerable: false
+ },
+ rgbToAnsi: {
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
+ enumerable: false
+ },
+ hexToAnsi: {
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
+ enumerable: false
+ }
+ });
+ return styles;
+}
+var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
+var init_ansi_styles = __esm({
+ "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
+ ANSI_BACKGROUND_OFFSET = 10;
+ wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
+ wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
+ wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
+ styles = {
+ modifier: {
+ reset: [0, 0],
+ // 21 isn't widely supported and 22 does the same thing
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ overline: [53, 55],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ color: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ // Bright color
+ blackBright: [90, 39],
+ gray: [90, 39],
+ // Alias of `blackBright`
+ grey: [90, 39],
+ // Alias of `blackBright`
+ redBright: [91, 39],
+ greenBright: [92, 39],
+ yellowBright: [93, 39],
+ blueBright: [94, 39],
+ magentaBright: [95, 39],
+ cyanBright: [96, 39],
+ whiteBright: [97, 39]
+ },
+ bgColor: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49],
+ // Bright color
+ bgBlackBright: [100, 49],
+ bgGray: [100, 49],
+ // Alias of `bgBlackBright`
+ bgGrey: [100, 49],
+ // Alias of `bgBlackBright`
+ bgRedBright: [101, 49],
+ bgGreenBright: [102, 49],
+ bgYellowBright: [103, 49],
+ bgBlueBright: [104, 49],
+ bgMagentaBright: [105, 49],
+ bgCyanBright: [106, 49],
+ bgWhiteBright: [107, 49]
+ }
+ };
+ modifierNames = Object.keys(styles.modifier);
+ foregroundColorNames = Object.keys(styles.color);
+ backgroundColorNames = Object.keys(styles.bgColor);
+ colorNames = [...foregroundColorNames, ...backgroundColorNames];
+ ansiStyles = assembleStyles();
+ ansi_styles_default = ansiStyles;
+ }
+});
+
+// node_modules/chalk/source/vendor/supports-color/index.js
+import process2 from "process";
+import os from "os";
+import tty from "tty";
+function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
+ const position = argv.indexOf(prefix + flag);
+ const terminatorPosition = argv.indexOf("--");
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
+}
+function envForceColor() {
+ if ("FORCE_COLOR" in env) {
+ if (env.FORCE_COLOR === "true") {
+ return 1;
+ }
+ if (env.FORCE_COLOR === "false") {
+ return 0;
+ }
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
+ }
+}
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
+ const noFlagForceColor = envForceColor();
+ if (noFlagForceColor !== void 0) {
+ flagForceColor = noFlagForceColor;
+ }
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
+ if (forceColor === 0) {
+ return 0;
+ }
+ if (sniffFlags) {
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
+ return 3;
+ }
+ if (hasFlag("color=256")) {
+ return 2;
+ }
+ }
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
+ return 1;
+ }
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
+ return 0;
+ }
+ const min = forceColor || 0;
+ if (env.TERM === "dumb") {
+ return min;
+ }
+ if (process2.platform === "win32") {
+ const osRelease = os.release().split(".");
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+ return 1;
+ }
+ if ("CI" in env) {
+ if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
+ return 3;
+ }
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") {
+ return 1;
+ }
+ return min;
+ }
+ if ("TEAMCITY_VERSION" in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+ if (env.COLORTERM === "truecolor") {
+ return 3;
+ }
+ if (env.TERM === "xterm-kitty") {
+ return 3;
+ }
+ if ("TERM_PROGRAM" in env) {
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
+ switch (env.TERM_PROGRAM) {
+ case "iTerm.app": {
+ return version >= 3 ? 3 : 2;
+ }
+ case "Apple_Terminal": {
+ return 2;
+ }
+ }
+ }
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+ if ("COLORTERM" in env) {
+ return 1;
+ }
+ return min;
+}
+function createSupportsColor(stream, options8 = {}) {
+ const level = _supportsColor(stream, {
+ streamIsTTY: stream && stream.isTTY,
+ ...options8
+ });
+ return translateLevel(level);
+}
+var env, flagForceColor, supportsColor, supports_color_default;
+var init_supports_color = __esm({
+ "node_modules/chalk/source/vendor/supports-color/index.js"() {
+ ({ env } = process2);
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
+ flagForceColor = 0;
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
+ flagForceColor = 1;
+ }
+ supportsColor = {
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
+ };
+ supports_color_default = supportsColor;
+ }
+});
+
+// node_modules/chalk/source/utilities.js
+function stringReplaceAll(string, substring, replacer) {
+ let index = string.indexOf(substring);
+ if (index === -1) {
+ return string;
+ }
+ const substringLength = substring.length;
+ let endIndex = 0;
+ let returnValue = "";
+ do {
+ returnValue += string.slice(endIndex, index) + substring + replacer;
+ endIndex = index + substringLength;
+ index = string.indexOf(substring, endIndex);
+ } while (index !== -1);
+ returnValue += string.slice(endIndex);
+ return returnValue;
+}
+function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
+ let endIndex = 0;
+ let returnValue = "";
+ do {
+ const gotCR = string[index - 1] === "\r";
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
+ endIndex = index + 1;
+ index = string.indexOf("\n", endIndex);
+ } while (index !== -1);
+ returnValue += string.slice(endIndex);
+ return returnValue;
+}
+var init_utilities = __esm({
+ "node_modules/chalk/source/utilities.js"() {
+ }
+});
+
+// node_modules/chalk/source/index.js
+var source_exports = {};
+__export(source_exports, {
+ Chalk: () => Chalk,
+ backgroundColorNames: () => backgroundColorNames,
+ backgroundColors: () => backgroundColorNames,
+ chalkStderr: () => chalkStderr,
+ colorNames: () => colorNames,
+ colors: () => colorNames,
+ default: () => source_default,
+ foregroundColorNames: () => foregroundColorNames,
+ foregroundColors: () => foregroundColorNames,
+ modifierNames: () => modifierNames,
+ modifiers: () => modifierNames,
+ supportsColor: () => stdoutColor,
+ supportsColorStderr: () => stderrColor
+});
+function createChalk(options8) {
+ return chalkFactory(options8);
+}
+var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, Chalk, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
+var init_source = __esm({
+ "node_modules/chalk/source/index.js"() {
+ init_ansi_styles();
+ init_supports_color();
+ init_utilities();
+ init_ansi_styles();
+ ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
+ GENERATOR = Symbol("GENERATOR");
+ STYLER = Symbol("STYLER");
+ IS_EMPTY = Symbol("IS_EMPTY");
+ levelMapping = [
+ "ansi",
+ "ansi",
+ "ansi256",
+ "ansi16m"
+ ];
+ styles2 = /* @__PURE__ */ Object.create(null);
+ applyOptions = (object, options8 = {}) => {
+ if (options8.level && !(Number.isInteger(options8.level) && options8.level >= 0 && options8.level <= 3)) {
+ throw new Error("The `level` option should be an integer from 0 to 3");
+ }
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
+ object.level = options8.level === void 0 ? colorLevel : options8.level;
+ };
+ Chalk = class {
+ constructor(options8) {
+ return chalkFactory(options8);
+ }
+ };
+ chalkFactory = (options8) => {
+ const chalk2 = (...strings) => strings.join(" ");
+ applyOptions(chalk2, options8);
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
+ return chalk2;
+ };
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
+ styles2[styleName] = {
+ get() {
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
+ Object.defineProperty(this, styleName, { value: builder });
+ return builder;
+ }
+ };
+ }
+ styles2.visible = {
+ get() {
+ const builder = createBuilder(this, this[STYLER], true);
+ Object.defineProperty(this, "visible", { value: builder });
+ return builder;
+ }
+ };
+ getModelAnsi = (model, level, type2, ...arguments_) => {
+ if (model === "rgb") {
+ if (level === "ansi16m") {
+ return ansi_styles_default[type2].ansi16m(...arguments_);
+ }
+ if (level === "ansi256") {
+ return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
+ }
+ return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
+ }
+ if (model === "hex") {
+ return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_));
+ }
+ return ansi_styles_default[type2][model](...arguments_);
+ };
+ usedModels = ["rgb", "hex", "ansi256"];
+ for (const model of usedModels) {
+ styles2[model] = {
+ get() {
+ const { level } = this;
+ return function(...arguments_) {
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
+ return createBuilder(this, styler, this[IS_EMPTY]);
+ };
+ }
+ };
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
+ styles2[bgModel] = {
+ get() {
+ const { level } = this;
+ return function(...arguments_) {
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
+ return createBuilder(this, styler, this[IS_EMPTY]);
+ };
+ }
+ };
+ }
+ proto = Object.defineProperties(() => {
+ }, {
+ ...styles2,
+ level: {
+ enumerable: true,
+ get() {
+ return this[GENERATOR].level;
+ },
+ set(level) {
+ this[GENERATOR].level = level;
+ }
+ }
+ });
+ createStyler = (open, close, parent) => {
+ let openAll;
+ let closeAll;
+ if (parent === void 0) {
+ openAll = open;
+ closeAll = close;
+ } else {
+ openAll = parent.openAll + open;
+ closeAll = close + parent.closeAll;
+ }
+ return {
+ open,
+ close,
+ openAll,
+ closeAll,
+ parent
+ };
+ };
+ createBuilder = (self, _styler, _isEmpty) => {
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
+ Object.setPrototypeOf(builder, proto);
+ builder[GENERATOR] = self;
+ builder[STYLER] = _styler;
+ builder[IS_EMPTY] = _isEmpty;
+ return builder;
+ };
+ applyStyle = (self, string) => {
+ if (self.level <= 0 || !string) {
+ return self[IS_EMPTY] ? "" : string;
+ }
+ let styler = self[STYLER];
+ if (styler === void 0) {
+ return string;
+ }
+ const { openAll, closeAll } = styler;
+ if (string.includes("\x1B")) {
+ while (styler !== void 0) {
+ string = stringReplaceAll(string, styler.close, styler.open);
+ styler = styler.parent;
+ }
+ }
+ const lfIndex = string.indexOf("\n");
+ if (lfIndex !== -1) {
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
+ }
+ return openAll + string + closeAll;
+ };
+ Object.defineProperties(createChalk.prototype, styles2);
+ chalk = createChalk();
+ chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
+ source_default = chalk;
+ }
+});
+
// node_modules/semver/internal/debug.js
var require_debug = __commonJS({
"node_modules/semver/internal/debug.js"(exports, module) {
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
};
@@ -5639,12 +6639,15 @@
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
- createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
createToken("COERCERTL", src[t.COERCE], true);
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
createToken("LONETILDE", "(?:~>?)");
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
exports.tildeTrimReplace = "$1~";
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
@@ -5830,11 +6833,11 @@
}
let i = 0;
do {
const a = this.build[i];
const b = other.build[i];
- debug("prerelease compare", i, a, b);
+ debug("build compare", i, a, b);
if (a === void 0 && b === void 0) {
return 0;
} else if (b === void 0) {
return 1;
} else if (a === void 0) {
@@ -6070,13 +7073,13 @@
module.exports = require_pseudomap();
}
}
});
-// node_modules/editorconfig/node_modules/yallist/yallist.js
+// node_modules/yallist/yallist.js
var require_yallist = __commonJS({
- "node_modules/editorconfig/node_modules/yallist/yallist.js"(exports, module) {
+ "node_modules/yallist/yallist.js"(exports, module) {
module.exports = Yallist;
Yallist.Node = Node;
Yallist.create = Yallist;
function Yallist(list) {
var self = this;
@@ -6685,12 +7688,11 @@
this[CACHE].set(key2, this[LRU_LIST].head);
trim2(this);
return true;
};
LRUCache.prototype.has = function(key2) {
- if (!this[CACHE].has(key2))
- return false;
+ if (!this[CACHE].has(key2)) return false;
var hit = this[CACHE].get(key2).value;
if (isStale(this, hit)) {
return false;
}
return true;
@@ -6701,12 +7703,11 @@
LRUCache.prototype.peek = function(key2) {
return get(this, key2, false);
};
LRUCache.prototype.pop = function() {
var node = this[LRU_LIST].tail;
- if (!node)
- return null;
+ if (!node) return null;
del(this, node);
return node.value;
};
LRUCache.prototype.del = function(key2) {
del(this, this[CACHE].get(key2));
@@ -6737,19 +7738,17 @@
var node = self[CACHE].get(key2);
if (node) {
var hit = node.value;
if (isStale(self, hit)) {
del(self, node);
- if (!self[ALLOW_STALE])
- hit = void 0;
+ if (!self[ALLOW_STALE]) hit = void 0;
} else {
if (doUse) {
self[LRU_LIST].unshiftNode(node);
}
}
- if (hit)
- hit = hit.value;
+ if (hit) hit = hit.value;
}
return hit;
}
function isStale(self, hit) {
if (!hit || !hit.maxAge && !self[MAX_AGE]) {
@@ -6802,29 +7801,25 @@
maxSessions = maxSessions || 10;
var notes = [];
var analysis = "";
var RE = RegExp;
function psychoAnalyze(subject2, session) {
- if (session > maxSessions)
- return;
+ if (session > maxSessions) return;
if (typeof subject2 === "function" || typeof subject2 === "undefined") {
return;
}
if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) {
analysis += subject2;
return;
}
- if (notes.indexOf(subject2) !== -1 || session === maxSessions)
- return;
+ if (notes.indexOf(subject2) !== -1 || session === maxSessions) return;
notes.push(subject2);
analysis += "{";
Object.keys(subject2).forEach(function(issue, _, __) {
- if (issue.charAt(0) === "_")
- return;
+ if (issue.charAt(0) === "_") return;
var to = typeof subject2[issue];
- if (to === "function" || to === "undefined")
- return;
+ if (to === "function" || to === "undefined") return;
analysis += issue;
psychoAnalyze(subject2[issue], session + 1);
});
}
psychoAnalyze(subject, 0);
@@ -6835,14 +7830,12 @@
// node_modules/editorconfig/src/lib/fnmatch.js
var require_fnmatch = __commonJS({
"node_modules/editorconfig/src/lib/fnmatch.js"(exports, module) {
var platform = typeof process === "object" ? process.platform : "win32";
- if (module)
- module.exports = minimatch;
- else
- exports.minimatch = minimatch;
+ if (module) module.exports = minimatch;
+ else exports.minimatch = minimatch;
minimatch.Minimatch = Minimatch;
var LRU = require_lru_cache();
var cache3 = minimatch.cache = new LRU({ max: 100 });
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
var sigmund = require_sigmund();
@@ -6862,12 +7855,11 @@
minimatch.monkeyPatch = monkeyPatch;
function monkeyPatch() {
var desc = Object.getOwnPropertyDescriptor(String.prototype, "match");
var orig = desc.value;
desc.value = function(p) {
- if (p instanceof Minimatch)
- return p.match(this);
+ if (p instanceof Minimatch) return p.match(this);
return orig.call(this, p);
};
Object.defineProperty(String.prototype, desc);
}
minimatch.filter = filter2;
@@ -6888,55 +7880,49 @@
t[k] = a[k];
});
return t;
}
minimatch.defaults = function(def) {
- if (!def || !Object.keys(def).length)
- return minimatch;
+ if (!def || !Object.keys(def).length) return minimatch;
var orig = minimatch;
var m = function minimatch2(p, pattern, options8) {
return orig.minimatch(p, pattern, ext(def, options8));
};
m.Minimatch = function Minimatch2(pattern, options8) {
return new orig.Minimatch(pattern, ext(def, options8));
};
return m;
};
Minimatch.defaults = function(def) {
- if (!def || !Object.keys(def).length)
- return Minimatch;
+ if (!def || !Object.keys(def).length) return Minimatch;
return minimatch.defaults(def).Minimatch;
};
function minimatch(p, pattern, options8) {
if (typeof pattern !== "string") {
throw new TypeError("glob pattern string required");
}
- if (!options8)
- options8 = {};
+ if (!options8) options8 = {};
if (!options8.nocomment && pattern.charAt(0) === "#") {
return false;
}
- if (pattern.trim() === "")
- return p === "";
+ if (pattern.trim() === "") return p === "";
return new Minimatch(pattern, options8).match(p);
}
function Minimatch(pattern, options8) {
if (!(this instanceof Minimatch)) {
return new Minimatch(pattern, options8, cache3);
}
if (typeof pattern !== "string") {
throw new TypeError("glob pattern string required");
}
- if (!options8)
- options8 = {};
+ if (!options8) options8 = {};
if (platform === "win32") {
pattern = pattern.split("\\").join("/");
}
var cacheKey = pattern + "\n" + sigmund(options8);
var cached = minimatch.cache.get(cacheKey);
- if (cached)
- return cached;
+ if (cached) return cached;
minimatch.cache.set(cacheKey, this);
this.options = options8;
this.set = [];
this.pattern = pattern;
this.regexp = null;
@@ -6945,12 +7931,11 @@
this.empty = false;
this.make();
}
Minimatch.prototype.make = make;
function make() {
- if (this._made)
- return;
+ if (this._made) return;
var pattern = this.pattern;
var options8 = this.options;
if (!options8.nocomment && pattern.charAt(0) === "#") {
this.comment = true;
return;
@@ -6959,40 +7944,34 @@
this.empty = true;
return;
}
this.parseNegate();
var set2 = this.globSet = this.braceExpand();
- if (options8.debug)
- console.error(this.pattern, set2);
+ if (options8.debug) console.error(this.pattern, set2);
set2 = this.globParts = set2.map(function(s) {
return s.split(slashSplit);
});
- if (options8.debug)
- console.error(this.pattern, set2);
+ if (options8.debug) console.error(this.pattern, set2);
set2 = set2.map(function(s, si, set3) {
return s.map(this.parse, this);
}, this);
- if (options8.debug)
- console.error(this.pattern, set2);
+ if (options8.debug) console.error(this.pattern, set2);
set2 = set2.filter(function(s) {
return -1 === s.indexOf(false);
});
- if (options8.debug)
- console.error(this.pattern, set2);
+ if (options8.debug) console.error(this.pattern, set2);
this.set = set2;
}
Minimatch.prototype.parseNegate = parseNegate;
function parseNegate() {
var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0;
- if (options8.nonegate)
- return;
+ if (options8.nonegate) return;
for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
negate = !negate;
negateOffset++;
}
- if (negateOffset)
- this.pattern = pattern.substr(negateOffset);
+ if (negateOffset) this.pattern = pattern.substr(negateOffset);
this.negate = negate;
}
minimatch.braceExpand = function(pattern, options8) {
return new Minimatch(pattern, options8).braceExpand();
};
@@ -7039,48 +8018,47 @@
var i = 1, depth = 1, set2 = [], member = "", sawEnd = false, escaping = false;
function addMember() {
set2.push(member);
member = "";
}
- FOR:
- for (i = 1, l = pattern.length; i < l; i++) {
- var c2 = pattern.charAt(i);
- if (escaping) {
- escaping = false;
- member += "\\" + c2;
- } else {
- switch (c2) {
- case "\\":
- escaping = true;
- continue;
- case "{":
- depth++;
- member += "{";
- continue;
- case "}":
- depth--;
- if (depth === 0) {
- addMember();
- i++;
- break FOR;
- } else {
- member += c2;
- continue;
- }
- case ",":
- if (depth === 1) {
- addMember();
- } else {
- member += c2;
- }
- continue;
- default:
+ FOR: for (i = 1, l = pattern.length; i < l; i++) {
+ var c2 = pattern.charAt(i);
+ if (escaping) {
+ escaping = false;
+ member += "\\" + c2;
+ } else {
+ switch (c2) {
+ case "\\":
+ escaping = true;
+ continue;
+ case "{":
+ depth++;
+ member += "{";
+ continue;
+ case "}":
+ depth--;
+ if (depth === 0) {
+ addMember();
+ i++;
+ break FOR;
+ } else {
member += c2;
continue;
- }
+ }
+ case ",":
+ if (depth === 1) {
+ addMember();
+ } else {
+ member += c2;
+ }
+ continue;
+ default:
+ member += c2;
+ continue;
}
}
+ }
if (depth !== 0) {
return braceExpand("\\" + pattern, options8);
}
var suf = braceExpand(pattern.substr(i), options8);
var addBraces = set2.length === 1;
@@ -7105,14 +8083,12 @@
}
Minimatch.prototype.parse = parse6;
var SUBPARSE = {};
function parse6(pattern, isSub) {
var options8 = this.options;
- if (!options8.noglobstar && pattern === "**")
- return GLOBSTAR;
- if (pattern === "")
- return "";
+ if (!options8.noglobstar && pattern === "**") return GLOBSTAR;
+ if (pattern === "") return "";
var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
function clearStateChar() {
if (stateChar) {
switch (stateChar) {
case "*":
@@ -7137,113 +8113,110 @@
if (escaping && reSpecials[c2]) {
re += "\\" + c2;
escaping = false;
continue;
}
- SWITCH:
- switch (c2) {
- case "/":
- return false;
- case "\\":
- clearStateChar();
- escaping = true;
+ SWITCH: switch (c2) {
+ case "/":
+ return false;
+ case "\\":
+ clearStateChar();
+ escaping = true;
+ continue;
+ case "?":
+ case "*":
+ case "+":
+ case "@":
+ case "!":
+ if (options8.debug) {
+ console.error("%s %s %s %j <-- stateChar", pattern, i, re, c2);
+ }
+ if (inClass) {
+ if (c2 === "!" && i === classStart + 1) c2 = "^";
+ re += c2;
continue;
- case "?":
- case "*":
- case "+":
- case "@":
- case "!":
- if (options8.debug) {
- console.error("%s %s %s %j <-- stateChar", pattern, i, re, c2);
- }
- if (inClass) {
- if (c2 === "!" && i === classStart + 1)
- c2 = "^";
- re += c2;
- continue;
- }
- clearStateChar();
- stateChar = c2;
- if (options8.noext)
- clearStateChar();
+ }
+ clearStateChar();
+ stateChar = c2;
+ if (options8.noext) clearStateChar();
+ continue;
+ case "(":
+ if (inClass) {
+ re += "(";
continue;
- case "(":
- if (inClass) {
- re += "(";
- continue;
- }
- if (!stateChar) {
- re += "\\(";
- continue;
- }
- plType = stateChar;
- patternListStack.push({
- type: plType,
- start: i - 1,
- reStart: re.length
- });
- re += stateChar === "!" ? "(?:(?!" : "(?:";
- stateChar = false;
+ }
+ if (!stateChar) {
+ re += "\\(";
continue;
- case ")":
- if (inClass || !patternListStack.length) {
- re += "\\)";
- continue;
- }
- hasMagic = true;
- re += ")";
- plType = patternListStack.pop().type;
- switch (plType) {
- case "!":
- re += "[^/]*?)";
- break;
- case "?":
- case "+":
- case "*":
- re += plType;
- case "@":
- break;
- }
+ }
+ plType = stateChar;
+ patternListStack.push({
+ type: plType,
+ start: i - 1,
+ reStart: re.length
+ });
+ re += stateChar === "!" ? "(?:(?!" : "(?:";
+ stateChar = false;
+ continue;
+ case ")":
+ if (inClass || !patternListStack.length) {
+ re += "\\)";
continue;
- case "|":
- if (inClass || !patternListStack.length || escaping) {
- re += "\\|";
- escaping = false;
- continue;
- }
- re += "|";
+ }
+ hasMagic = true;
+ re += ")";
+ plType = patternListStack.pop().type;
+ switch (plType) {
+ case "!":
+ re += "[^/]*?)";
+ break;
+ case "?":
+ case "+":
+ case "*":
+ re += plType;
+ case "@":
+ break;
+ }
+ continue;
+ case "|":
+ if (inClass || !patternListStack.length || escaping) {
+ re += "\\|";
+ escaping = false;
continue;
- case "[":
- clearStateChar();
- if (inClass) {
- re += "\\" + c2;
- continue;
- }
- inClass = true;
- classStart = i;
- reClassStart = re.length;
- re += c2;
+ }
+ re += "|";
+ continue;
+ case "[":
+ clearStateChar();
+ if (inClass) {
+ re += "\\" + c2;
continue;
- case "]":
- if (i === classStart + 1 || !inClass) {
- re += "\\" + c2;
- escaping = false;
- continue;
- }
- hasMagic = true;
- inClass = false;
- re += c2;
+ }
+ inClass = true;
+ classStart = i;
+ reClassStart = re.length;
+ re += c2;
+ continue;
+ case "]":
+ if (i === classStart + 1 || !inClass) {
+ re += "\\" + c2;
+ escaping = false;
continue;
- default:
- clearStateChar();
- if (escaping) {
- escaping = false;
- } else if (reSpecials[c2] && !(c2 === "^" && inClass)) {
- re += "\\";
- }
- re += c2;
- }
+ }
+ hasMagic = true;
+ inClass = false;
+ re += c2;
+ continue;
+ default:
+ clearStateChar();
+ if (escaping) {
+ escaping = false;
+ } else if (reSpecials[c2] && !(c2 === "^" && inClass)) {
+ re += "\\";
+ }
+ re += c2;
+ }
}
if (inClass) {
var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE);
re = re.substr(0, reClassStart) + "\\[" + sp[0];
hasMagic = hasMagic || sp[1];
@@ -7270,14 +8243,12 @@
case ".":
case "[":
case "(":
addPatternStart = true;
}
- if (re !== "" && hasMagic)
- re = "(?=.)" + re;
- if (addPatternStart)
- re = patternStart + re;
+ if (re !== "" && hasMagic) re = "(?=.)" + re;
+ if (addPatternStart) re = patternStart + re;
if (isSub === SUBPARSE) {
return [re, hasMagic];
}
if (!hasMagic) {
return globUnescape(pattern);
@@ -7290,25 +8261,22 @@
minimatch.makeRe = function(pattern, options8) {
return new Minimatch(pattern, options8 || {}).makeRe();
};
Minimatch.prototype.makeRe = makeRe;
function makeRe() {
- if (this.regexp || this.regexp === false)
- return this.regexp;
+ if (this.regexp || this.regexp === false) return this.regexp;
var set2 = this.set;
- if (!set2.length)
- return this.regexp = false;
+ if (!set2.length) return this.regexp = false;
var options8 = this.options;
var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : "";
var re = set2.map(function(pattern) {
return pattern.map(function(p) {
return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
}).join("\\/");
}).join("|");
re = "^(?:" + re + ")$";
- if (this.negate)
- re = "^(?!" + re + ").*$";
+ if (this.negate) re = "^(?!" + re + ").*$";
try {
return this.regexp = new RegExp(re, flags);
} catch (ex) {
return this.regexp = false;
}
@@ -7323,16 +8291,13 @@
}
return list;
};
Minimatch.prototype.match = match;
function match(f, partial) {
- if (this.comment)
- return false;
- if (this.empty)
- return f === "";
- if (f === "/" && partial)
- return true;
+ if (this.comment) return false;
+ if (this.empty) return f === "";
+ if (f === "/" && partial) return true;
var options8 = this.options;
if (platform === "win32") {
f = f.split("\\").join("/");
}
f = f.split(slashSplit);
@@ -7342,17 +8307,15 @@
var set2 = this.set;
for (var i = 0, l = set2.length; i < l; i++) {
var pattern = set2[i];
var hit = this.matchOne(f, pattern, partial);
if (hit) {
- if (options8.flipNegate)
- return true;
+ if (options8.flipNegate) return true;
return !this.negate;
}
}
- if (options8.flipNegate)
- return false;
+ if (options8.flipNegate) return false;
return this.negate;
}
Minimatch.prototype.matchOne = function(file, pattern, partial) {
var options8 = this.options;
if (options8.debug) {
@@ -7377,56 +8340,52 @@
}
var p = pattern[pi], f = file[fi];
if (options8.debug) {
console.error(pattern, p, f);
}
- if (p === false)
- return false;
+ if (p === false) return false;
if (p === GLOBSTAR) {
if (options8.debug)
console.error("GLOBSTAR", [pattern, p, f]);
var fr = fi, pr = pi + 1;
if (pr === pl) {
if (options8.debug)
console.error("** at the end");
for (; fi < fl; fi++) {
- if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".")
- return false;
+ if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".") return false;
}
return true;
}
- WHILE:
- while (fr < fl) {
- var swallowee = file[fr];
- if (options8.debug) {
- console.error(
- "\nglobstar while",
- file,
- fr,
- pattern,
- pr,
- swallowee
- );
- }
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+ WHILE: while (fr < fl) {
+ var swallowee = file[fr];
+ if (options8.debug) {
+ console.error(
+ "\nglobstar while",
+ file,
+ fr,
+ pattern,
+ pr,
+ swallowee
+ );
+ }
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+ if (options8.debug)
+ console.error("globstar found match!", fr, fl, swallowee);
+ return true;
+ } else {
+ if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") {
if (options8.debug)
- console.error("globstar found match!", fr, fl, swallowee);
- return true;
- } else {
- if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") {
- if (options8.debug)
- console.error("dot detected!", file, fr, pattern, pr);
- break WHILE;
- }
- if (options8.debug)
- console.error("globstar swallow a segment, and continue");
- fr++;
+ console.error("dot detected!", file, fr, pattern, pr);
+ break WHILE;
}
+ if (options8.debug)
+ console.error("globstar swallow a segment, and continue");
+ fr++;
}
+ }
if (partial) {
- if (fr === fl)
- return true;
+ if (fr === fl) return true;
}
return false;
}
var hit;
if (typeof p === "string") {
@@ -7442,12 +8401,11 @@
hit = f.match(p);
if (options8.debug) {
console.error("pattern match", p, f, hit);
}
}
- if (!hit)
- return false;
+ if (!hit) return false;
}
if (fi === fl && pi === pl) {
return true;
} else if (fi === fl) {
return partial;
@@ -7494,12 +8452,11 @@
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = exports && exports.__generator || function(thisArg, body) {
var _ = { label: 0, sent: function() {
- if (t[0] & 1)
- throw t[1];
+ if (t[0] & 1) throw t[1];
return t[1];
}, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
@@ -7507,79 +8464,70 @@
return function(v) {
return step([n, v]);
};
}
function step(op) {
- if (f)
- throw new TypeError("Generator is already executing.");
- while (_)
- try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
- return t;
- if (y = 0, t)
- op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0:
- case 1:
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0:
+ case 1:
+ t = op;
+ break;
+ case 4:
+ _.label++;
+ return { value: op[1], done: false };
+ case 5:
+ _.label++;
+ y = op[1];
+ op = [0];
+ continue;
+ case 7:
+ op = _.ops.pop();
+ _.trys.pop();
+ continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+ }
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
+ _.label = op[1];
+ break;
+ }
+ if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
t = op;
break;
- case 4:
- _.label++;
- return { value: op[1], done: false };
- case 5:
- _.label++;
- y = op[1];
- op = [0];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t[1]) {
- _.label = t[1];
- t = op;
- break;
- }
- if (t && _.label < t[2]) {
- _.label = t[2];
- _.ops.push(op);
- break;
- }
- if (t[2])
- _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e) {
- op = [6, e];
- y = 0;
- } finally {
- f = t = 0;
+ }
+ if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+ }
+ if (t[2]) _.ops.pop();
+ _.trys.pop();
+ continue;
}
- if (op[0] & 5)
- throw op[1];
+ op = body.call(thisArg, _);
+ } catch (e) {
+ op = [6, e];
+ y = 0;
+ } finally {
+ f = t = 0;
+ }
+ if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importStar = exports && exports.__importStar || function(mod) {
- if (mod && mod.__esModule)
- return mod;
+ if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) {
- for (var k in mod)
- if (Object.hasOwnProperty.call(mod, k))
- result[k] = mod[k];
+ for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
}
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
@@ -7728,12 +8676,11 @@
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = exports && exports.__generator || function(thisArg, body) {
var _ = { label: 0, sent: function() {
- if (t[0] & 1)
- throw t[1];
+ if (t[0] & 1) throw t[1];
return t[1];
}, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
@@ -7741,79 +8688,70 @@
return function(v) {
return step([n, v]);
};
}
function step(op) {
- if (f)
- throw new TypeError("Generator is already executing.");
- while (_)
- try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
- return t;
- if (y = 0, t)
- op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0:
- case 1:
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0:
+ case 1:
+ t = op;
+ break;
+ case 4:
+ _.label++;
+ return { value: op[1], done: false };
+ case 5:
+ _.label++;
+ y = op[1];
+ op = [0];
+ continue;
+ case 7:
+ op = _.ops.pop();
+ _.trys.pop();
+ continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+ }
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
+ _.label = op[1];
+ break;
+ }
+ if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
t = op;
break;
- case 4:
- _.label++;
- return { value: op[1], done: false };
- case 5:
- _.label++;
- y = op[1];
- op = [0];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t[1]) {
- _.label = t[1];
- t = op;
- break;
- }
- if (t && _.label < t[2]) {
- _.label = t[2];
- _.ops.push(op);
- break;
- }
- if (t[2])
- _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e) {
- op = [6, e];
- y = 0;
- } finally {
- f = t = 0;
+ }
+ if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+ }
+ if (t[2]) _.ops.pop();
+ _.trys.pop();
+ continue;
}
- if (op[0] & 5)
- throw op[1];
+ op = body.call(thisArg, _);
+ } catch (e) {
+ op = [6, e];
+ y = 0;
+ } finally {
+ f = t = 0;
+ }
+ if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importStar = exports && exports.__importStar || function(mod) {
- if (mod && mod.__esModule)
- return mod;
+ if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) {
- for (var k in mod)
- if (Object.hasOwnProperty.call(mod, k))
- result[k] = mod[k];
+ for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
}
result["default"] = mod;
return result;
};
var __importDefault = exports && exports.__importDefault || function(mod) {
@@ -8435,12 +9373,11 @@
env2.CI_NAME || // Codeship and others
env2.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
env2.RUN_ID || // TaskCluster, dsari
exports.name || false));
function checkEnv(obj) {
- if (typeof obj === "string")
- return !!env2[obj];
+ if (typeof obj === "string") return !!env2[obj];
if ("env" in obj) {
return env2[obj.env] && env2[obj.env].includes(obj.includes);
}
if ("any" in obj) {
return obj.any.some(function(k) {
@@ -8463,12 +9400,11 @@
/* istanbul ignore next */
constructor(msg, filename, linenumber) {
super("[ParserError] " + msg, filename, linenumber);
this.name = "ParserError";
this.code = "ParserError";
- if (Error.captureStackTrace)
- Error.captureStackTrace(this, _ParserError);
+ if (Error.captureStackTrace) Error.captureStackTrace(this, _ParserError);
}
};
var State = class {
constructor(parser) {
this.parser = parser;
@@ -8491,12 +9427,11 @@
this.char = null;
this.ii = 0;
this.state = new State(this.parseStart);
}
parse(str2) {
- if (str2.length === 0 || str2.length == null)
- return;
+ if (str2.length === 0 || str2.length == null) return;
this._buf = String(str2);
this.ii = -1;
this.char = -1;
let getNext;
while (getNext === false || this.nextChar()) {
@@ -8532,43 +9467,38 @@
this.state = null;
this._buf = null;
return this.obj;
}
next(fn) {
- if (typeof fn !== "function")
- throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
+ if (typeof fn !== "function") throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
this.state.parser = fn;
}
goto(fn) {
this.next(fn);
return this.runOne();
}
call(fn, returnWith) {
- if (returnWith)
- this.next(returnWith);
+ if (returnWith) this.next(returnWith);
this.stack.push(this.state);
this.state = new State(fn);
}
callNow(fn, returnWith) {
this.call(fn, returnWith);
return this.runOne();
}
return(value) {
- if (this.stack.length === 0)
- throw this.error(new ParserError("Stack underflow"));
- if (value === void 0)
- value = this.state.buf;
+ if (this.stack.length === 0) throw this.error(new ParserError("Stack underflow"));
+ if (value === void 0) value = this.state.buf;
this.state = this.stack.pop();
this.state.returned = value;
}
returnNow(value) {
this.return(value);
return this.runOne();
}
consume() {
- if (this.char === ParserEND)
- throw this.error(new ParserError("Unexpected end-of-buffer"));
+ if (this.char === ParserEND) throw this.error(new ParserError("Unexpected end-of-buffer"));
this.state.buf += this._buf[this.ii];
}
error(err) {
err.line = this.line;
err.col = this.col;
@@ -8605,12 +9535,11 @@
var require_format_num = __commonJS({
"node_modules/@iarna/toml/lib/format-num.js"(exports, module) {
"use strict";
module.exports = (d, num) => {
num = String(num);
- while (num.length < d)
- num = "0" + num;
+ while (num.length < d) num = "0" + num;
return num;
};
}
});
@@ -8700,12 +9629,11 @@
module.exports.makeParserClass = makeParserClass;
var TomlError = class _TomlError extends Error {
constructor(msg) {
super(msg);
this.name = "TomlError";
- if (Error.captureStackTrace)
- Error.captureStackTrace(this, _TomlError);
+ if (Error.captureStackTrace) Error.captureStackTrace(this, _TomlError);
this.fromTOML = true;
this.wrapped = null;
}
};
TomlError.wrap = (err) => {
@@ -8797,37 +9725,33 @@
var _declared = Symbol("declared");
var hasOwnProperty3 = Object.prototype.hasOwnProperty;
var defineProperty = Object.defineProperty;
var descriptor = { configurable: true, enumerable: true, writable: true, value: void 0 };
function hasKey(obj, key2) {
- if (hasOwnProperty3.call(obj, key2))
- return true;
- if (key2 === "__proto__")
- defineProperty(obj, "__proto__", descriptor);
+ if (hasOwnProperty3.call(obj, key2)) return true;
+ if (key2 === "__proto__") defineProperty(obj, "__proto__", descriptor);
return false;
}
var INLINE_TABLE = Symbol("inline-table");
function InlineTable() {
return Object.defineProperties({}, {
[_type]: { value: INLINE_TABLE }
});
}
function isInlineTable(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === INLINE_TABLE;
}
var TABLE = Symbol("table");
function Table() {
return Object.defineProperties({}, {
[_type]: { value: TABLE },
[_declared]: { value: false, writable: true }
});
}
function isTable(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === TABLE;
}
var _contentType = Symbol("content-type");
var INLINE_LIST = Symbol("inline-list");
function InlineList(type2) {
@@ -8835,23 +9759,21 @@
[_type]: { value: INLINE_LIST },
[_contentType]: { value: type2 }
});
}
function isInlineList(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === INLINE_LIST;
}
var LIST = Symbol("list");
function List() {
return Object.defineProperties([], {
[_type]: { value: LIST }
});
}
function isList(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === LIST;
}
var _custom;
try {
const utilInspect = __require("util").inspect;
@@ -8884,12 +9806,11 @@
}
};
var INTEGER = Symbol("integer");
function Integer(value) {
let num = Number(value);
- if (Object.is(num, -0))
- num = 0;
+ if (Object.is(num, -0)) num = 0;
if (global.BigInt && !Number.isSafeInteger(num)) {
return new BoxedBigInt(value);
} else {
return Object.defineProperties(new Number(num), {
isNaN: { value: function() {
@@ -8899,33 +9820,29 @@
[_inspect]: { value: () => `[Integer: ${value}]` }
});
}
}
function isInteger2(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === INTEGER;
}
var FLOAT = Symbol("float");
function Float(value) {
return Object.defineProperties(new Number(value), {
[_type]: { value: FLOAT },
[_inspect]: { value: () => `[Float: ${value}]` }
});
}
function isFloat2(obj) {
- if (obj === null || typeof obj !== "object")
- return false;
+ if (obj === null || typeof obj !== "object") return false;
return obj[_type] === FLOAT;
}
function tomlType(value) {
const type2 = typeof value;
if (type2 === "object") {
- if (value === null)
- return "null";
- if (value instanceof Date)
- return "datetime";
+ if (value === null) return "null";
+ if (value instanceof Date) return "datetime";
if (_type in value) {
switch (value[_type]) {
case INLINE_TABLE:
return "inline-table";
case INLINE_LIST:
@@ -9445,21 +10362,19 @@
parseSmallUnicode() {
if (!isHexit(this.char)) {
throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
} else {
this.consume();
- if (this.state.buf.length >= 4)
- return this.return();
+ if (this.state.buf.length >= 4) return this.return();
}
}
parseLargeUnicode() {
if (!isHexit(this.char)) {
throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
} else {
this.consume();
- if (this.state.buf.length >= 8)
- return this.return();
+ if (this.state.buf.length >= 8) return this.return();
}
}
/* NUMBERS */
parseNumberSign() {
this.consume();
@@ -9572,12 +10487,11 @@
parseNumberOrDateTimeOnly() {
if (this.char === CHAR_LOWBAR) {
return this.call(this.parseNoUnder, this.parseNumberInteger);
} else if (isDigit(this.char)) {
this.consume();
- if (this.state.buf.length > 4)
- this.next(this.parseNumberInteger);
+ if (this.state.buf.length > 4) this.next(this.parseNumberInteger);
} else if (this.char === CHAR_E || this.char === CHAR_e) {
this.consume();
return this.next(this.parseNumberExponentSign);
} else if (this.char === CHAR_PERIOD) {
this.consume();
@@ -9794,12 +10708,11 @@
}
parseOnlyTimeFraction() {
if (isDigit(this.char)) {
this.consume();
} else if (this.atEndOfWord()) {
- if (this.state.buf.length === 0)
- throw this.error(new TomlError("Expected digit in milliseconds"));
+ if (this.state.buf.length === 0) throw this.error(new TomlError("Expected digit in milliseconds"));
return this.returnNow(createTime(this.state.result + "." + this.state.buf));
} else {
throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
}
}
@@ -9837,12 +10750,11 @@
}
}
parseTimeZoneHour() {
if (isDigit(this.char)) {
this.consume();
- if (/\d\d$/.test(this.state.buf))
- return this.next(this.parseTimeZoneSep);
+ if (/\d\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep);
} else {
throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
}
}
parseTimeZoneSep() {
@@ -9854,12 +10766,11 @@
}
}
parseTimeZoneMin() {
if (isDigit(this.char)) {
this.consume();
- if (/\d\d$/.test(this.state.buf))
- return this.return(createDateTime(this.state.result + this.state.buf));
+ if (/\d\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf));
} else {
throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
}
}
/* BOOLEAN */
@@ -9977,12 +10888,11 @@
} else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
throw this.error(new TomlError("Unterminated inline array"));
} else if (this.char === CHAR_RCUB) {
return this.return(this.state.resultTable || InlineTable());
} else {
- if (!this.state.resultTable)
- this.state.resultTable = InlineTable();
+ if (!this.state.resultTable) this.state.resultTable = InlineTable();
return this.callNow(this.parseAssign, this.recordInlineTableValue);
}
}
recordInlineTableValue(kv) {
let target = this.state.resultTable;
@@ -10026,25 +10936,22 @@
var require_parse_pretty_error = __commonJS({
"node_modules/@iarna/toml/parse-pretty-error.js"(exports, module) {
"use strict";
module.exports = prettyError;
function prettyError(err, buf) {
- if (err.pos == null || err.line == null)
- return err;
+ if (err.pos == null || err.line == null) return err;
let msg = err.message;
msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:
`;
if (buf && buf.split) {
const lines = buf.split(/\n/);
const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
let linePadding = " ";
- while (linePadding.length < lineNumWidth)
- linePadding += " ";
+ while (linePadding.length < lineNumWidth) linePadding += " ";
for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
let lineNum = String(ii + 1);
- if (lineNum.length < lineNumWidth)
- lineNum = " " + lineNum;
+ if (lineNum.length < lineNumWidth) lineNum = " " + lineNum;
if (err.line === ii) {
msg += lineNum + "> " + lines[ii] + "\n";
msg += linePadding + " ";
for (let hh = 0; hh < err.col; ++hh) {
msg += " ";
@@ -10067,12 +10974,11 @@
"use strict";
module.exports = parseAsync;
var TOMLParser = require_toml_parser();
var prettyError = require_parse_pretty_error();
function parseAsync(str2, opts) {
- if (!opts)
- opts = {};
+ if (!opts) opts = {};
const index = 0;
const blocksize = opts.blocksize || 40960;
const parser = new TOMLParser();
return new Promise((resolve3, reject) => {
setImmediate(parseAsyncNext, index, blocksize, resolve3, reject);
@@ -10103,26 +11009,18 @@
value: true
});
exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
exports.matchToToken = function(match) {
var token2 = { type: "invalid", value: match[0], closed: void 0 };
- if (match[1])
- token2.type = "string", token2.closed = !!(match[3] || match[4]);
- else if (match[5])
- token2.type = "comment";
- else if (match[6])
- token2.type = "comment", token2.closed = !!match[7];
- else if (match[8])
- token2.type = "regex";
- else if (match[9])
- token2.type = "number";
- else if (match[10])
- token2.type = "name";
- else if (match[11])
- token2.type = "punctuator";
- else if (match[12])
- token2.type = "whitespace";
+ if (match[1]) token2.type = "string", token2.closed = !!(match[3] || match[4]);
+ else if (match[5]) token2.type = "comment";
+ else if (match[6]) token2.type = "comment", token2.closed = !!match[7];
+ else if (match[8]) token2.type = "regex";
+ else if (match[9]) token2.type = "number";
+ else if (match[10]) token2.type = "name";
+ else if (match[11]) token2.type = "punctuator";
+ else if (match[12]) token2.type = "whitespace";
return token2;
};
}
});
@@ -10145,45 +11043,33 @@
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
function isInAstralSet(code, set2) {
let pos2 = 65536;
for (let i = 0, length = set2.length; i < length; i += 2) {
pos2 += set2[i];
- if (pos2 > code)
- return false;
+ if (pos2 > code) return false;
pos2 += set2[i + 1];
- if (pos2 >= code)
- return true;
+ if (pos2 >= code) return true;
}
return false;
}
function isIdentifierStart(code) {
- if (code < 65)
- return code === 36;
- if (code <= 90)
- return true;
- if (code < 97)
- return code === 95;
- if (code <= 122)
- return true;
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
if (code <= 65535) {
return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes);
}
function isIdentifierChar(code) {
- if (code < 48)
- return code === 36;
- if (code < 58)
- return true;
- if (code < 65)
- return false;
- if (code <= 90)
- return true;
- if (code < 97)
- return code === 95;
- if (code <= 122)
- return true;
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
if (code <= 65535) {
return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
}
@@ -10307,1553 +11193,59 @@
var _identifier = require_identifier();
var _keyword = require_keyword();
}
});
-// node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js
-var require_escape_string_regexp = __commonJS({
- "node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js"(exports, module) {
- "use strict";
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
- module.exports = function(str2) {
- if (typeof str2 !== "string") {
- throw new TypeError("Expected a string");
- }
- return str2.replace(matchOperatorsRe, "\\$&");
+// node_modules/picocolors/picocolors.js
+var require_picocolors = __commonJS({
+ "node_modules/picocolors/picocolors.js"(exports, module) {
+ var tty2 = __require("tty");
+ var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
+ var formatter = (open, close, replace = open) => (input) => {
+ let string = "" + input;
+ let index = string.indexOf(close, open.length);
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
- }
-});
-
-// node_modules/color-name/index.js
-var require_color_name = __commonJS({
- "node_modules/color-name/index.js"(exports, module) {
- "use strict";
- module.exports = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "grey": [128, 128, 128],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "rebeccapurple": [102, 51, 153],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
+ var replaceClose = (string, close, replace, index) => {
+ let start = string.substring(0, index) + replace;
+ let end = string.substring(index + close.length);
+ let nextIndex = end.indexOf(close);
+ return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
};
- }
-});
-
-// node_modules/color-convert/conversions.js
-var require_conversions = __commonJS({
- "node_modules/color-convert/conversions.js"(exports, module) {
- var cssKeywords = require_color_name();
- var reverseKeywords = {};
- for (key2 in cssKeywords) {
- if (cssKeywords.hasOwnProperty(key2)) {
- reverseKeywords[cssKeywords[key2]] = key2;
- }
- }
- var key2;
- var convert = module.exports = {
- rgb: { channels: 3, labels: "rgb" },
- hsl: { channels: 3, labels: "hsl" },
- hsv: { channels: 3, labels: "hsv" },
- hwb: { channels: 3, labels: "hwb" },
- cmyk: { channels: 4, labels: "cmyk" },
- xyz: { channels: 3, labels: "xyz" },
- lab: { channels: 3, labels: "lab" },
- lch: { channels: 3, labels: "lch" },
- hex: { channels: 1, labels: ["hex"] },
- keyword: { channels: 1, labels: ["keyword"] },
- ansi16: { channels: 1, labels: ["ansi16"] },
- ansi256: { channels: 1, labels: ["ansi256"] },
- hcg: { channels: 3, labels: ["h", "c", "g"] },
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
- gray: { channels: 1, labels: ["gray"] }
- };
- for (model in convert) {
- if (convert.hasOwnProperty(model)) {
- if (!("channels" in convert[model])) {
- throw new Error("missing channels property: " + model);
- }
- if (!("labels" in convert[model])) {
- throw new Error("missing channel labels property: " + model);
- }
- if (convert[model].labels.length !== convert[model].channels) {
- throw new Error("channel and label counts mismatch: " + model);
- }
- channels = convert[model].channels;
- labels = convert[model].labels;
- delete convert[model].channels;
- delete convert[model].labels;
- Object.defineProperty(convert[model], "channels", { value: channels });
- Object.defineProperty(convert[model], "labels", { value: labels });
- }
- }
- var channels;
- var labels;
- var model;
- convert.rgb.hsl = function(rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var min = Math.min(r, g, b);
- var max = Math.max(r, g, b);
- var delta = max - min;
- var h;
- var s;
- var l;
- if (max === min) {
- h = 0;
- } else if (r === max) {
- h = (g - b) / delta;
- } else if (g === max) {
- h = 2 + (b - r) / delta;
- } else if (b === max) {
- h = 4 + (r - g) / delta;
- }
- h = Math.min(h * 60, 360);
- if (h < 0) {
- h += 360;
- }
- l = (min + max) / 2;
- if (max === min) {
- s = 0;
- } else if (l <= 0.5) {
- s = delta / (max + min);
- } else {
- s = delta / (2 - max - min);
- }
- return [h, s * 100, l * 100];
- };
- convert.rgb.hsv = function(rgb) {
- var rdif;
- var gdif;
- var bdif;
- var h;
- var s;
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var v = Math.max(r, g, b);
- var diff = v - Math.min(r, g, b);
- var diffc = function(c2) {
- return (v - c2) / 6 / diff + 1 / 2;
- };
- if (diff === 0) {
- h = s = 0;
- } else {
- s = diff / v;
- rdif = diffc(r);
- gdif = diffc(g);
- bdif = diffc(b);
- if (r === v) {
- h = bdif - gdif;
- } else if (g === v) {
- h = 1 / 3 + rdif - bdif;
- } else if (b === v) {
- h = 2 / 3 + gdif - rdif;
- }
- if (h < 0) {
- h += 1;
- } else if (h > 1) {
- h -= 1;
- }
- }
- return [
- h * 360,
- s * 100,
- v * 100
- ];
- };
- convert.rgb.hwb = function(rgb) {
- var r = rgb[0];
- var g = rgb[1];
- var b = rgb[2];
- var h = convert.rgb.hsl(rgb)[0];
- var w = 1 / 255 * Math.min(r, Math.min(g, b));
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
- return [h, w * 100, b * 100];
- };
- convert.rgb.cmyk = function(rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var c2;
- var m;
- var y;
- var k;
- k = Math.min(1 - r, 1 - g, 1 - b);
- c2 = (1 - r - k) / (1 - k) || 0;
- m = (1 - g - k) / (1 - k) || 0;
- y = (1 - b - k) / (1 - k) || 0;
- return [c2 * 100, m * 100, y * 100, k * 100];
- };
- function comparativeDistance(x, y) {
- return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
- }
- convert.rgb.keyword = function(rgb) {
- var reversed = reverseKeywords[rgb];
- if (reversed) {
- return reversed;
- }
- var currentClosestDistance = Infinity;
- var currentClosestKeyword;
- for (var keyword in cssKeywords) {
- if (cssKeywords.hasOwnProperty(keyword)) {
- var value = cssKeywords[keyword];
- var distance = comparativeDistance(rgb, value);
- if (distance < currentClosestDistance) {
- currentClosestDistance = distance;
- currentClosestKeyword = keyword;
- }
- }
- }
- return currentClosestKeyword;
- };
- convert.keyword.rgb = function(keyword) {
- return cssKeywords[keyword];
- };
- convert.rgb.xyz = function(rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
- g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
- b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
- var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
- var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
- var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
- return [x * 100, y * 100, z * 100];
- };
- convert.rgb.lab = function(rgb) {
- var xyz = convert.rgb.xyz(rgb);
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
- x /= 95.047;
- y /= 100;
- z /= 108.883;
- x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
- y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
- l = 116 * y - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
- return [l, a, b];
- };
- convert.hsl.rgb = function(hsl) {
- var h = hsl[0] / 360;
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var t1;
- var t2;
- var t3;
- var rgb;
- var val;
- if (s === 0) {
- val = l * 255;
- return [val, val, val];
- }
- if (l < 0.5) {
- t2 = l * (1 + s);
- } else {
- t2 = l + s - l * s;
- }
- t1 = 2 * l - t2;
- rgb = [0, 0, 0];
- for (var i = 0; i < 3; i++) {
- t3 = h + 1 / 3 * -(i - 1);
- if (t3 < 0) {
- t3++;
- }
- if (t3 > 1) {
- t3--;
- }
- if (6 * t3 < 1) {
- val = t1 + (t2 - t1) * 6 * t3;
- } else if (2 * t3 < 1) {
- val = t2;
- } else if (3 * t3 < 2) {
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
- } else {
- val = t1;
- }
- rgb[i] = val * 255;
- }
- return rgb;
- };
- convert.hsl.hsv = function(hsl) {
- var h = hsl[0];
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var smin = s;
- var lmin = Math.max(l, 0.01);
- var sv;
- var v;
- l *= 2;
- s *= l <= 1 ? l : 2 - l;
- smin *= lmin <= 1 ? lmin : 2 - lmin;
- v = (l + s) / 2;
- sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
- return [h, sv * 100, v * 100];
- };
- convert.hsv.rgb = function(hsv) {
- var h = hsv[0] / 60;
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var hi = Math.floor(h) % 6;
- var f = h - Math.floor(h);
- var p = 255 * v * (1 - s);
- var q = 255 * v * (1 - s * f);
- var t = 255 * v * (1 - s * (1 - f));
- v *= 255;
- switch (hi) {
- case 0:
- return [v, t, p];
- case 1:
- return [q, v, p];
- case 2:
- return [p, v, t];
- case 3:
- return [p, q, v];
- case 4:
- return [t, p, v];
- case 5:
- return [v, p, q];
- }
- };
- convert.hsv.hsl = function(hsv) {
- var h = hsv[0];
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var vmin = Math.max(v, 0.01);
- var lmin;
- var sl;
- var l;
- l = (2 - s) * v;
- lmin = (2 - s) * vmin;
- sl = s * vmin;
- sl /= lmin <= 1 ? lmin : 2 - lmin;
- sl = sl || 0;
- l /= 2;
- return [h, sl * 100, l * 100];
- };
- convert.hwb.rgb = function(hwb) {
- var h = hwb[0] / 360;
- var wh = hwb[1] / 100;
- var bl = hwb[2] / 100;
- var ratio = wh + bl;
- var i;
- var v;
- var f;
- var n;
- if (ratio > 1) {
- wh /= ratio;
- bl /= ratio;
- }
- i = Math.floor(6 * h);
- v = 1 - bl;
- f = 6 * h - i;
- if ((i & 1) !== 0) {
- f = 1 - f;
- }
- n = wh + f * (v - wh);
- var r;
- var g;
- var b;
- switch (i) {
- default:
- case 6:
- case 0:
- r = v;
- g = n;
- b = wh;
- break;
- case 1:
- r = n;
- g = v;
- b = wh;
- break;
- case 2:
- r = wh;
- g = v;
- b = n;
- break;
- case 3:
- r = wh;
- g = n;
- b = v;
- break;
- case 4:
- r = n;
- g = wh;
- b = v;
- break;
- case 5:
- r = v;
- g = wh;
- b = n;
- break;
- }
- return [r * 255, g * 255, b * 255];
- };
- convert.cmyk.rgb = function(cmyk) {
- var c2 = cmyk[0] / 100;
- var m = cmyk[1] / 100;
- var y = cmyk[2] / 100;
- var k = cmyk[3] / 100;
- var r;
- var g;
- var b;
- r = 1 - Math.min(1, c2 * (1 - k) + k);
- g = 1 - Math.min(1, m * (1 - k) + k);
- b = 1 - Math.min(1, y * (1 - k) + k);
- return [r * 255, g * 255, b * 255];
- };
- convert.xyz.rgb = function(xyz) {
- var x = xyz[0] / 100;
- var y = xyz[1] / 100;
- var z = xyz[2] / 100;
- var r;
- var g;
- var b;
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
- b = x * 0.0557 + y * -0.204 + z * 1.057;
- r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92;
- g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92;
- b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92;
- r = Math.min(Math.max(0, r), 1);
- g = Math.min(Math.max(0, g), 1);
- b = Math.min(Math.max(0, b), 1);
- return [r * 255, g * 255, b * 255];
- };
- convert.xyz.lab = function(xyz) {
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
- x /= 95.047;
- y /= 100;
- z /= 108.883;
- x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
- y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
- l = 116 * y - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
- return [l, a, b];
- };
- convert.lab.xyz = function(lab) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var x;
- var y;
- var z;
- y = (l + 16) / 116;
- x = a / 500 + y;
- z = y - b / 200;
- var y2 = Math.pow(y, 3);
- var x2 = Math.pow(x, 3);
- var z2 = Math.pow(z, 3);
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
- x *= 95.047;
- y *= 100;
- z *= 108.883;
- return [x, y, z];
- };
- convert.lab.lch = function(lab) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var hr;
- var h;
- var c2;
- hr = Math.atan2(b, a);
- h = hr * 360 / 2 / Math.PI;
- if (h < 0) {
- h += 360;
- }
- c2 = Math.sqrt(a * a + b * b);
- return [l, c2, h];
- };
- convert.lch.lab = function(lch) {
- var l = lch[0];
- var c2 = lch[1];
- var h = lch[2];
- var a;
- var b;
- var hr;
- hr = h / 360 * 2 * Math.PI;
- a = c2 * Math.cos(hr);
- b = c2 * Math.sin(hr);
- return [l, a, b];
- };
- convert.rgb.ansi16 = function(args) {
- var r = args[0];
- var g = args[1];
- var b = args[2];
- var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
- value = Math.round(value / 50);
- if (value === 0) {
- return 30;
- }
- var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
- if (value === 2) {
- ansi += 60;
- }
- return ansi;
- };
- convert.hsv.ansi16 = function(args) {
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
- };
- convert.rgb.ansi256 = function(args) {
- var r = args[0];
- var g = args[1];
- var b = args[2];
- if (r === g && g === b) {
- if (r < 8) {
- return 16;
- }
- if (r > 248) {
- return 231;
- }
- return Math.round((r - 8) / 247 * 24) + 232;
- }
- var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
- return ansi;
- };
- convert.ansi16.rgb = function(args) {
- var color = args % 10;
- if (color === 0 || color === 7) {
- if (args > 50) {
- color += 3.5;
- }
- color = color / 10.5 * 255;
- return [color, color, color];
- }
- var mult = (~~(args > 50) + 1) * 0.5;
- var r = (color & 1) * mult * 255;
- var g = (color >> 1 & 1) * mult * 255;
- var b = (color >> 2 & 1) * mult * 255;
- return [r, g, b];
- };
- convert.ansi256.rgb = function(args) {
- if (args >= 232) {
- var c2 = (args - 232) * 10 + 8;
- return [c2, c2, c2];
- }
- args -= 16;
- var rem;
- var r = Math.floor(args / 36) / 5 * 255;
- var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
- var b = rem % 6 / 5 * 255;
- return [r, g, b];
- };
- convert.rgb.hex = function(args) {
- var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
- var string = integer.toString(16).toUpperCase();
- return "000000".substring(string.length) + string;
- };
- convert.hex.rgb = function(args) {
- var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
- if (!match) {
- return [0, 0, 0];
- }
- var colorString = match[0];
- if (match[0].length === 3) {
- colorString = colorString.split("").map(function(char) {
- return char + char;
- }).join("");
- }
- var integer = parseInt(colorString, 16);
- var r = integer >> 16 & 255;
- var g = integer >> 8 & 255;
- var b = integer & 255;
- return [r, g, b];
- };
- convert.rgb.hcg = function(rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var max = Math.max(Math.max(r, g), b);
- var min = Math.min(Math.min(r, g), b);
- var chroma = max - min;
- var grayscale;
- var hue;
- if (chroma < 1) {
- grayscale = min / (1 - chroma);
- } else {
- grayscale = 0;
- }
- if (chroma <= 0) {
- hue = 0;
- } else if (max === r) {
- hue = (g - b) / chroma % 6;
- } else if (max === g) {
- hue = 2 + (b - r) / chroma;
- } else {
- hue = 4 + (r - g) / chroma + 4;
- }
- hue /= 6;
- hue %= 1;
- return [hue * 360, chroma * 100, grayscale * 100];
- };
- convert.hsl.hcg = function(hsl) {
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var c2 = 1;
- var f = 0;
- if (l < 0.5) {
- c2 = 2 * s * l;
- } else {
- c2 = 2 * s * (1 - l);
- }
- if (c2 < 1) {
- f = (l - 0.5 * c2) / (1 - c2);
- }
- return [hsl[0], c2 * 100, f * 100];
- };
- convert.hsv.hcg = function(hsv) {
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var c2 = s * v;
- var f = 0;
- if (c2 < 1) {
- f = (v - c2) / (1 - c2);
- }
- return [hsv[0], c2 * 100, f * 100];
- };
- convert.hcg.rgb = function(hcg) {
- var h = hcg[0] / 360;
- var c2 = hcg[1] / 100;
- var g = hcg[2] / 100;
- if (c2 === 0) {
- return [g * 255, g * 255, g * 255];
- }
- var pure = [0, 0, 0];
- var hi = h % 1 * 6;
- var v = hi % 1;
- var w = 1 - v;
- var mg = 0;
- switch (Math.floor(hi)) {
- case 0:
- pure[0] = 1;
- pure[1] = v;
- pure[2] = 0;
- break;
- case 1:
- pure[0] = w;
- pure[1] = 1;
- pure[2] = 0;
- break;
- case 2:
- pure[0] = 0;
- pure[1] = 1;
- pure[2] = v;
- break;
- case 3:
- pure[0] = 0;
- pure[1] = w;
- pure[2] = 1;
- break;
- case 4:
- pure[0] = v;
- pure[1] = 0;
- pure[2] = 1;
- break;
- default:
- pure[0] = 1;
- pure[1] = 0;
- pure[2] = w;
- }
- mg = (1 - c2) * g;
- return [
- (c2 * pure[0] + mg) * 255,
- (c2 * pure[1] + mg) * 255,
- (c2 * pure[2] + mg) * 255
- ];
- };
- convert.hcg.hsv = function(hcg) {
- var c2 = hcg[1] / 100;
- var g = hcg[2] / 100;
- var v = c2 + g * (1 - c2);
- var f = 0;
- if (v > 0) {
- f = c2 / v;
- }
- return [hcg[0], f * 100, v * 100];
- };
- convert.hcg.hsl = function(hcg) {
- var c2 = hcg[1] / 100;
- var g = hcg[2] / 100;
- var l = g * (1 - c2) + 0.5 * c2;
- var s = 0;
- if (l > 0 && l < 0.5) {
- s = c2 / (2 * l);
- } else if (l >= 0.5 && l < 1) {
- s = c2 / (2 * (1 - l));
- }
- return [hcg[0], s * 100, l * 100];
- };
- convert.hcg.hwb = function(hcg) {
- var c2 = hcg[1] / 100;
- var g = hcg[2] / 100;
- var v = c2 + g * (1 - c2);
- return [hcg[0], (v - c2) * 100, (1 - v) * 100];
- };
- convert.hwb.hcg = function(hwb) {
- var w = hwb[1] / 100;
- var b = hwb[2] / 100;
- var v = 1 - b;
- var c2 = v - w;
- var g = 0;
- if (c2 < 1) {
- g = (v - c2) / (1 - c2);
- }
- return [hwb[0], c2 * 100, g * 100];
- };
- convert.apple.rgb = function(apple) {
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
- };
- convert.rgb.apple = function(rgb) {
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
- };
- convert.gray.rgb = function(args) {
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
- };
- convert.gray.hsl = convert.gray.hsv = function(args) {
- return [0, 0, args[0]];
- };
- convert.gray.hwb = function(gray) {
- return [0, 100, gray[0]];
- };
- convert.gray.cmyk = function(gray) {
- return [0, 0, 0, gray[0]];
- };
- convert.gray.lab = function(gray) {
- return [gray[0], 0, 0];
- };
- convert.gray.hex = function(gray) {
- var val = Math.round(gray[0] / 100 * 255) & 255;
- var integer = (val << 16) + (val << 8) + val;
- var string = integer.toString(16).toUpperCase();
- return "000000".substring(string.length) + string;
- };
- convert.rgb.gray = function(rgb) {
- var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
- return [val / 255 * 100];
- };
- }
-});
-
-// node_modules/color-convert/route.js
-var require_route = __commonJS({
- "node_modules/color-convert/route.js"(exports, module) {
- var conversions = require_conversions();
- function buildGraph() {
- var graph = {};
- var models = Object.keys(conversions);
- for (var len = models.length, i = 0; i < len; i++) {
- graph[models[i]] = {
- // http://jsperf.com/1-vs-infinity
- // micro-opt, but this is simple.
- distance: -1,
- parent: null
- };
- }
- return graph;
- }
- function deriveBFS(fromModel) {
- var graph = buildGraph();
- var queue = [fromModel];
- graph[fromModel].distance = 0;
- while (queue.length) {
- var current = queue.pop();
- var adjacents = Object.keys(conversions[current]);
- for (var len = adjacents.length, i = 0; i < len; i++) {
- var adjacent = adjacents[i];
- var node = graph[adjacent];
- if (node.distance === -1) {
- node.distance = graph[current].distance + 1;
- node.parent = current;
- queue.unshift(adjacent);
- }
- }
- }
- return graph;
- }
- function link(from, to) {
- return function(args) {
- return to(from(args));
- };
- }
- function wrapConversion(toModel, graph) {
- var path13 = [graph[toModel].parent, toModel];
- var fn = conversions[graph[toModel].parent][toModel];
- var cur = graph[toModel].parent;
- while (graph[cur].parent) {
- path13.unshift(graph[cur].parent);
- fn = link(conversions[graph[cur].parent][cur], fn);
- cur = graph[cur].parent;
- }
- fn.conversion = path13;
- return fn;
- }
- module.exports = function(fromModel) {
- var graph = deriveBFS(fromModel);
- var conversion = {};
- var models = Object.keys(graph);
- for (var len = models.length, i = 0; i < len; i++) {
- var toModel = models[i];
- var node = graph[toModel];
- if (node.parent === null) {
- continue;
- }
- conversion[toModel] = wrapConversion(toModel, graph);
- }
- return conversion;
- };
- }
-});
-
-// node_modules/color-convert/index.js
-var require_color_convert = __commonJS({
- "node_modules/color-convert/index.js"(exports, module) {
- var conversions = require_conversions();
- var route = require_route();
- var convert = {};
- var models = Object.keys(conversions);
- function wrapRaw(fn) {
- var wrappedFn = function(args) {
- if (args === void 0 || args === null) {
- return args;
- }
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
- return fn(args);
- };
- if ("conversion" in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
- }
- function wrapRounded(fn) {
- var wrappedFn = function(args) {
- if (args === void 0 || args === null) {
- return args;
- }
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
- var result = fn(args);
- if (typeof result === "object") {
- for (var len = result.length, i = 0; i < len; i++) {
- result[i] = Math.round(result[i]);
- }
- }
- return result;
- };
- if ("conversion" in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
- }
- models.forEach(function(fromModel) {
- convert[fromModel] = {};
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
- var routes = route(fromModel);
- var routeModels = Object.keys(routes);
- routeModels.forEach(function(toModel) {
- var fn = routes[toModel];
- convert[fromModel][toModel] = wrapRounded(fn);
- convert[fromModel][toModel].raw = wrapRaw(fn);
- });
+ var createColors = (enabled = isColorSupported) => ({
+ isColorSupported: enabled,
+ reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
+ bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
+ dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
+ italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
+ underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
+ inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
+ hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
+ strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
+ black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
+ red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
+ green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
+ yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
+ blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
+ magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
+ cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
+ white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
+ gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
+ bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
+ bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
+ bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
+ bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
+ bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
+ bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
+ bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
+ bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
});
- module.exports = convert;
+ module.exports = createColors();
+ module.exports.createColors = createColors;
}
});
-// node_modules/@babel/code-frame/node_modules/ansi-styles/index.js
-var require_ansi_styles = __commonJS({
- "node_modules/@babel/code-frame/node_modules/ansi-styles/index.js"(exports, module) {
- "use strict";
- var colorConvert = require_color_convert();
- var wrapAnsi162 = (fn, offset) => function() {
- const code = fn.apply(colorConvert, arguments);
- return `\x1B[${code + offset}m`;
- };
- var wrapAnsi2562 = (fn, offset) => function() {
- const code = fn.apply(colorConvert, arguments);
- return `\x1B[${38 + offset};5;${code}m`;
- };
- var wrapAnsi16m2 = (fn, offset) => function() {
- const rgb = fn.apply(colorConvert, arguments);
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
- };
- function assembleStyles2() {
- const codes2 = /* @__PURE__ */ new Map();
- const styles3 = {
- modifier: {
- reset: [0, 0],
- // 21 isn't widely supported and 22 does the same thing
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
- // Bright color
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- // Bright color
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
- styles3.color.grey = styles3.color.gray;
- for (const groupName of Object.keys(styles3)) {
- const group = styles3[groupName];
- for (const styleName of Object.keys(group)) {
- const style = group[styleName];
- styles3[styleName] = {
- open: `\x1B[${style[0]}m`,
- close: `\x1B[${style[1]}m`
- };
- group[styleName] = styles3[styleName];
- codes2.set(style[0], style[1]);
- }
- Object.defineProperty(styles3, groupName, {
- value: group,
- enumerable: false
- });
- Object.defineProperty(styles3, "codes", {
- value: codes2,
- enumerable: false
- });
- }
- const ansi2ansi = (n) => n;
- const rgb2rgb = (r, g, b) => [r, g, b];
- styles3.color.close = "\x1B[39m";
- styles3.bgColor.close = "\x1B[49m";
- styles3.color.ansi = {
- ansi: wrapAnsi162(ansi2ansi, 0)
- };
- styles3.color.ansi256 = {
- ansi256: wrapAnsi2562(ansi2ansi, 0)
- };
- styles3.color.ansi16m = {
- rgb: wrapAnsi16m2(rgb2rgb, 0)
- };
- styles3.bgColor.ansi = {
- ansi: wrapAnsi162(ansi2ansi, 10)
- };
- styles3.bgColor.ansi256 = {
- ansi256: wrapAnsi2562(ansi2ansi, 10)
- };
- styles3.bgColor.ansi16m = {
- rgb: wrapAnsi16m2(rgb2rgb, 10)
- };
- for (let key2 of Object.keys(colorConvert)) {
- if (typeof colorConvert[key2] !== "object") {
- continue;
- }
- const suite = colorConvert[key2];
- if (key2 === "ansi16") {
- key2 = "ansi";
- }
- if ("ansi16" in suite) {
- styles3.color.ansi[key2] = wrapAnsi162(suite.ansi16, 0);
- styles3.bgColor.ansi[key2] = wrapAnsi162(suite.ansi16, 10);
- }
- if ("ansi256" in suite) {
- styles3.color.ansi256[key2] = wrapAnsi2562(suite.ansi256, 0);
- styles3.bgColor.ansi256[key2] = wrapAnsi2562(suite.ansi256, 10);
- }
- if ("rgb" in suite) {
- styles3.color.ansi16m[key2] = wrapAnsi16m2(suite.rgb, 0);
- styles3.bgColor.ansi16m[key2] = wrapAnsi16m2(suite.rgb, 10);
- }
- }
- return styles3;
- }
- Object.defineProperty(module, "exports", {
- enumerable: true,
- get: assembleStyles2
- });
- }
-});
-
-// node_modules/@babel/code-frame/node_modules/has-flag/index.js
-var require_has_flag = __commonJS({
- "node_modules/@babel/code-frame/node_modules/has-flag/index.js"(exports, module) {
- "use strict";
- module.exports = (flag, argv) => {
- argv = argv || process.argv;
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
- const pos2 = argv.indexOf(prefix + flag);
- const terminatorPos = argv.indexOf("--");
- return pos2 !== -1 && (terminatorPos === -1 ? true : pos2 < terminatorPos);
- };
- }
-});
-
-// node_modules/@babel/code-frame/node_modules/supports-color/index.js
-var require_supports_color = __commonJS({
- "node_modules/@babel/code-frame/node_modules/supports-color/index.js"(exports, module) {
- "use strict";
- var os2 = __require("os");
- var hasFlag2 = require_has_flag();
- var env2 = process.env;
- var forceColor;
- if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) {
- forceColor = false;
- } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
- forceColor = true;
- }
- if ("FORCE_COLOR" in env2) {
- forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
- }
- function translateLevel2(level) {
- if (level === 0) {
- return false;
- }
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
- }
- function supportsColor2(stream) {
- if (forceColor === false) {
- return 0;
- }
- if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
- return 3;
- }
- if (hasFlag2("color=256")) {
- return 2;
- }
- if (stream && !stream.isTTY && forceColor !== true) {
- return 0;
- }
- const min = forceColor ? 1 : 0;
- if (process.platform === "win32") {
- const osRelease = os2.release().split(".");
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
- return 1;
- }
- if ("CI" in env2) {
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign2) => sign2 in env2) || env2.CI_NAME === "codeship") {
- return 1;
- }
- return min;
- }
- if ("TEAMCITY_VERSION" in env2) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
- }
- if (env2.COLORTERM === "truecolor") {
- return 3;
- }
- if ("TERM_PROGRAM" in env2) {
- const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
- switch (env2.TERM_PROGRAM) {
- case "iTerm.app":
- return version >= 3 ? 3 : 2;
- case "Apple_Terminal":
- return 2;
- }
- }
- if (/-256(color)?$/i.test(env2.TERM)) {
- return 2;
- }
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
- return 1;
- }
- if ("COLORTERM" in env2) {
- return 1;
- }
- if (env2.TERM === "dumb") {
- return min;
- }
- return min;
- }
- function getSupportLevel(stream) {
- const level = supportsColor2(stream);
- return translateLevel2(level);
- }
- module.exports = {
- supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr)
- };
- }
-});
-
-// node_modules/@babel/code-frame/node_modules/chalk/templates.js
-var require_templates = __commonJS({
- "node_modules/@babel/code-frame/node_modules/chalk/templates.js"(exports, module) {
- "use strict";
- var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
- var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
- var ESCAPES = /* @__PURE__ */ new Map([
- ["n", "\n"],
- ["r", "\r"],
- ["t", " "],
- ["b", "\b"],
- ["f", "\f"],
- ["v", "\v"],
- ["0", "\0"],
- ["\\", "\\"],
- ["e", "\x1B"],
- ["a", "\x07"]
- ]);
- function unescape(c2) {
- if (c2[0] === "u" && c2.length === 5 || c2[0] === "x" && c2.length === 3) {
- return String.fromCharCode(parseInt(c2.slice(1), 16));
- }
- return ESCAPES.get(c2) || c2;
- }
- function parseArguments(name, args) {
- const results = [];
- const chunks = args.trim().split(/\s*,\s*/g);
- let matches;
- for (const chunk of chunks) {
- if (!isNaN(chunk)) {
- results.push(Number(chunk));
- } else if (matches = chunk.match(STRING_REGEX)) {
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, chr) => escape2 ? unescape(escape2) : chr));
- } else {
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
- }
- }
- return results;
- }
- function parseStyle(style) {
- STYLE_REGEX.lastIndex = 0;
- const results = [];
- let matches;
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
- const name = matches[1];
- if (matches[2]) {
- const args = parseArguments(name, matches[2]);
- results.push([name].concat(args));
- } else {
- results.push([name]);
- }
- }
- return results;
- }
- function buildStyle(chalk2, styles3) {
- const enabled = {};
- for (const layer of styles3) {
- for (const style of layer.styles) {
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
- }
- }
- let current = chalk2;
- for (const styleName of Object.keys(enabled)) {
- if (Array.isArray(enabled[styleName])) {
- if (!(styleName in current)) {
- throw new Error(`Unknown Chalk style: ${styleName}`);
- }
- if (enabled[styleName].length > 0) {
- current = current[styleName].apply(current, enabled[styleName]);
- } else {
- current = current[styleName];
- }
- }
- }
- return current;
- }
- module.exports = (chalk2, tmp) => {
- const styles3 = [];
- const chunks = [];
- let chunk = [];
- tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
- if (escapeChar) {
- chunk.push(unescape(escapeChar));
- } else if (style) {
- const str2 = chunk.join("");
- chunk = [];
- chunks.push(styles3.length === 0 ? str2 : buildStyle(chalk2, styles3)(str2));
- styles3.push({ inverse, styles: parseStyle(style) });
- } else if (close) {
- if (styles3.length === 0) {
- throw new Error("Found extraneous } in Chalk template literal");
- }
- chunks.push(buildStyle(chalk2, styles3)(chunk.join("")));
- chunk = [];
- styles3.pop();
- } else {
- chunk.push(chr);
- }
- });
- chunks.push(chunk.join(""));
- if (styles3.length > 0) {
- const errMsg = `Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`;
- throw new Error(errMsg);
- }
- return chunks.join("");
- };
- }
-});
-
-// node_modules/@babel/code-frame/node_modules/chalk/index.js
-var require_chalk = __commonJS({
- "node_modules/@babel/code-frame/node_modules/chalk/index.js"(exports, module) {
- "use strict";
- var escapeStringRegexp2 = require_escape_string_regexp();
- var ansiStyles2 = require_ansi_styles();
- var stdoutColor2 = require_supports_color().stdout;
- var template = require_templates();
- var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
- var levelMapping2 = ["ansi", "ansi", "ansi256", "ansi16m"];
- var skipModels = /* @__PURE__ */ new Set(["gray"]);
- var styles3 = /* @__PURE__ */ Object.create(null);
- function applyOptions2(obj, options8) {
- options8 = options8 || {};
- const scLevel = stdoutColor2 ? stdoutColor2.level : 0;
- obj.level = options8.level === void 0 ? scLevel : options8.level;
- obj.enabled = "enabled" in options8 ? options8.enabled : obj.level > 0;
- }
- function Chalk(options8) {
- if (!this || !(this instanceof Chalk) || this.template) {
- const chalk2 = {};
- applyOptions2(chalk2, options8);
- chalk2.template = function() {
- const args = [].slice.call(arguments);
- return chalkTag.apply(null, [chalk2.template].concat(args));
- };
- Object.setPrototypeOf(chalk2, Chalk.prototype);
- Object.setPrototypeOf(chalk2.template, chalk2);
- chalk2.template.constructor = Chalk;
- return chalk2.template;
- }
- applyOptions2(this, options8);
- }
- if (isSimpleWindowsTerm) {
- ansiStyles2.blue.open = "\x1B[94m";
- }
- for (const key2 of Object.keys(ansiStyles2)) {
- ansiStyles2[key2].closeRe = new RegExp(escapeStringRegexp2(ansiStyles2[key2].close), "g");
- styles3[key2] = {
- get() {
- const codes2 = ansiStyles2[key2];
- return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key2);
- }
- };
- }
- styles3.visible = {
- get() {
- return build.call(this, this._styles || [], true, "visible");
- }
- };
- ansiStyles2.color.closeRe = new RegExp(escapeStringRegexp2(ansiStyles2.color.close), "g");
- for (const model of Object.keys(ansiStyles2.color.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
- styles3[model] = {
- get() {
- const level = this.level;
- return function() {
- const open = ansiStyles2.color[levelMapping2[level]][model].apply(null, arguments);
- const codes2 = {
- open,
- close: ansiStyles2.color.close,
- closeRe: ansiStyles2.color.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
- };
- }
- };
- }
- ansiStyles2.bgColor.closeRe = new RegExp(escapeStringRegexp2(ansiStyles2.bgColor.close), "g");
- for (const model of Object.keys(ansiStyles2.bgColor.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
- styles3[bgModel] = {
- get() {
- const level = this.level;
- return function() {
- const open = ansiStyles2.bgColor[levelMapping2[level]][model].apply(null, arguments);
- const codes2 = {
- open,
- close: ansiStyles2.bgColor.close,
- closeRe: ansiStyles2.bgColor.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
- };
- }
- };
- }
- var proto2 = Object.defineProperties(() => {
- }, styles3);
- function build(_styles, _empty, key2) {
- const builder = function() {
- return applyStyle2.apply(builder, arguments);
- };
- builder._styles = _styles;
- builder._empty = _empty;
- const self = this;
- Object.defineProperty(builder, "level", {
- enumerable: true,
- get() {
- return self.level;
- },
- set(level) {
- self.level = level;
- }
- });
- Object.defineProperty(builder, "enabled", {
- enumerable: true,
- get() {
- return self.enabled;
- },
- set(enabled) {
- self.enabled = enabled;
- }
- });
- builder.hasGrey = this.hasGrey || key2 === "gray" || key2 === "grey";
- builder.__proto__ = proto2;
- return builder;
- }
- function applyStyle2() {
- const args = arguments;
- const argsLen = args.length;
- let str2 = String(arguments[0]);
- if (argsLen === 0) {
- return "";
- }
- if (argsLen > 1) {
- for (let a = 1; a < argsLen; a++) {
- str2 += " " + args[a];
- }
- }
- if (!this.enabled || this.level <= 0 || !str2) {
- return this._empty ? "" : str2;
- }
- const originalDim = ansiStyles2.dim.open;
- if (isSimpleWindowsTerm && this.hasGrey) {
- ansiStyles2.dim.open = "";
- }
- for (const code of this._styles.slice().reverse()) {
- str2 = code.open + str2.replace(code.closeRe, code.open) + code.close;
- str2 = str2.replace(/\r?\n/g, `${code.close}$&${code.open}`);
- }
- ansiStyles2.dim.open = originalDim;
- return str2;
- }
- function chalkTag(chalk2, strings) {
- if (!Array.isArray(strings)) {
- return [].slice.call(arguments, 1).join(" ");
- }
- const args = [].slice.call(arguments, 2);
- const parts = [strings.raw[0]];
- for (let i = 1; i < strings.length; i++) {
- parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
- parts.push(String(strings.raw[i]));
- }
- return template(chalk2, parts.join(""));
- }
- Object.defineProperties(Chalk.prototype, styles3);
- module.exports = Chalk();
- module.exports.supportsColor = stdoutColor2;
- module.exports.default = module.exports;
- }
-});
-
// node_modules/@babel/highlight/lib/index.js
var require_lib2 = __commonJS({
"node_modules/@babel/highlight/lib/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -11861,47 +11253,44 @@
});
exports.default = highlight;
exports.shouldHighlight = shouldHighlight;
var _jsTokens = require_js_tokens();
var _helperValidatorIdentifier = require_lib();
- var _chalk = _interopRequireWildcard(require_chalk(), true);
+ var _picocolors = _interopRequireWildcard(require_picocolors(), true);
function _getRequireWildcardCache(e) {
- if ("function" != typeof WeakMap)
- return null;
+ if ("function" != typeof WeakMap) return null;
var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function(e2) {
return e2 ? t : r;
})(e);
}
function _interopRequireWildcard(e, r) {
- if (!r && e && e.__esModule)
- return e;
- if (null === e || "object" != typeof e && "function" != typeof e)
- return { default: e };
+ if (!r && e && e.__esModule) return e;
+ if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };
var t = _getRequireWildcardCache(r);
- if (t && t.has(e))
- return t.get(e);
+ if (t && t.has(e)) return t.get(e);
var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var u in e)
- if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
- }
+ for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
+ }
return n.default = e, t && t.set(e, n), n;
}
+ var colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
+ var compose = (f, g) => (v) => f(g(v));
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
- function getDefs(chalk2) {
+ function getDefs(colors2) {
return {
- keyword: chalk2.cyan,
- capitalized: chalk2.yellow,
- jsxIdentifier: chalk2.yellow,
- punctuator: chalk2.yellow,
- number: chalk2.magenta,
- string: chalk2.green,
- regex: chalk2.magenta,
- comment: chalk2.grey,
- invalid: chalk2.white.bgRed.bold
+ keyword: colors2.cyan,
+ capitalized: colors2.yellow,
+ jsxIdentifier: colors2.yellow,
+ punctuator: colors2.yellow,
+ number: colors2.magenta,
+ string: colors2.green,
+ regex: colors2.magenta,
+ comment: colors2.gray,
+ invalid: compose(compose(colors2.white, colors2.bgRed), colors2.bold)
};
}
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
var BRACKET = /^[()[\]{}]$/;
var tokenize;
@@ -11910,11 +11299,11 @@
const getTokenType = function(token2, offset, text) {
if (token2.type === "name") {
if ((0, _helperValidatorIdentifier.isKeyword)(token2.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token2.value, true) || sometimesKeywords.has(token2.value)) {
return "keyword";
}
- if (JSX_TAG.test(token2.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == "</")) {
+ if (JSX_TAG.test(token2.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
return "jsxIdentifier";
}
if (token2.value[0] !== token2.value[0].toLowerCase()) {
return "capitalized";
}
@@ -11952,35 +11341,47 @@
}
}
return highlighted;
}
function shouldHighlight(options8) {
- return _chalk.default.level > 0 || options8.forceColor;
+ return colors.isColorSupported || options8.forceColor;
}
- var chalkWithForcedColor = void 0;
- function getChalk(forceColor) {
+ var pcWithForcedColor = void 0;
+ function getColors(forceColor) {
if (forceColor) {
- var _chalkWithForcedColor;
- (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new _chalk.default.constructor({
- enabled: true,
- level: 1
- });
- return chalkWithForcedColor;
+ var _pcWithForcedColor;
+ (_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
+ return pcWithForcedColor;
}
- return _chalk.default;
+ return colors;
}
- {
- exports.getChalk = (options8) => getChalk(options8.forceColor);
- }
function highlight(code, options8 = {}) {
if (code !== "" && shouldHighlight(options8)) {
- const defs = getDefs(getChalk(options8.forceColor));
+ const defs = getDefs(getColors(options8.forceColor));
return highlightTokens(defs, code);
} else {
return code;
}
}
+ {
+ let chalk2, chalkWithForcedColor;
+ exports.getChalk = ({
+ forceColor
+ }) => {
+ var _chalk;
+ (_chalk = chalk2) != null ? _chalk : chalk2 = (init_source(), __toCommonJS(source_exports));
+ if (forceColor) {
+ var _chalkWithForcedColor;
+ (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk2.constructor({
+ enabled: true,
+ level: 1
+ });
+ return chalkWithForcedColor;
+ }
+ return chalk2;
+ };
+ }
}
});
// node_modules/@babel/code-frame/lib/index.js
var require_lib3 = __commonJS({
@@ -11990,53 +11391,47 @@
value: true
});
exports.codeFrameColumns = codeFrameColumns3;
exports.default = _default2;
var _highlight = require_lib2();
- var _chalk = _interopRequireWildcard(require_chalk(), true);
+ var _picocolors = _interopRequireWildcard(require_picocolors(), true);
function _getRequireWildcardCache(e) {
- if ("function" != typeof WeakMap)
- return null;
+ if ("function" != typeof WeakMap) return null;
var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function(e2) {
return e2 ? t : r;
})(e);
}
function _interopRequireWildcard(e, r) {
- if (!r && e && e.__esModule)
- return e;
- if (null === e || "object" != typeof e && "function" != typeof e)
- return { default: e };
+ if (!r && e && e.__esModule) return e;
+ if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };
var t = _getRequireWildcardCache(r);
- if (t && t.has(e))
- return t.get(e);
+ if (t && t.has(e)) return t.get(e);
var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var u in e)
- if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
- }
+ for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
+ }
return n.default = e, t && t.set(e, n), n;
}
- var chalkWithForcedColor = void 0;
- function getChalk(forceColor) {
+ var colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
+ var compose = (f, g) => (v) => f(g(v));
+ var pcWithForcedColor = void 0;
+ function getColors(forceColor) {
if (forceColor) {
- var _chalkWithForcedColor;
- (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new _chalk.default.constructor({
- enabled: true,
- level: 1
- });
- return chalkWithForcedColor;
+ var _pcWithForcedColor;
+ (_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
+ return pcWithForcedColor;
}
- return _chalk.default;
+ return colors;
}
var deprecationWarningShown = false;
- function getDefs(chalk2) {
+ function getDefs(colors2) {
return {
- gutter: chalk2.grey,
- marker: chalk2.red.bold,
- message: chalk2.red.bold
+ gutter: colors2.gray,
+ marker: compose(colors2.red, colors2.bold),
+ message: compose(colors2.red, colors2.bold)
};
}
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
function getMarkerLines(loc, source2, opts) {
const startLoc = Object.assign({
@@ -12094,14 +11489,14 @@
markerLines
};
}
function codeFrameColumns3(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
- const chalk2 = getChalk(opts.forceColor);
- const defs = getDefs(chalk2);
- const maybeHighlight = (chalkFn, string) => {
- return highlighted ? chalkFn(string) : string;
+ const colors2 = getColors(opts.forceColor);
+ const defs = getDefs(colors2);
+ const maybeHighlight = (fmt, string) => {
+ return highlighted ? fmt(string) : string;
};
const lines = rawLines.split(NEWLINE);
const {
start,
end,
@@ -12134,11 +11529,11 @@
if (opts.message && !hasColumns) {
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
${frame}`;
}
if (highlighted) {
- return chalk2.reset(frame);
+ return colors2.reset(frame);
} else {
return frame;
}
}
function _default2(rawLines, lineNumber, colNumber, opts = {}) {
@@ -12551,12 +11946,11 @@
"use strict";
var fs7 = __require("fs");
var LineByLine = class {
constructor(file, options8) {
options8 = options8 || {};
- if (!options8.readChunk)
- options8.readChunk = 1024;
+ if (!options8.readChunk) options8.readChunk = 1024;
if (!options8.newLineCharacter) {
options8.newLineCharacter = 10;
} else {
options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0);
}
@@ -12633,12 +12027,11 @@
}
}
return totalBytesRead;
}
next() {
- if (!this.fd)
- return false;
+ if (!this.fd) return false;
let line3 = false;
if (this.eofReached && this.linesCache.length === 0) {
return line3;
}
let bytesRead;
@@ -12666,231 +12059,10 @@
};
module.exports = LineByLine;
}
});
-// node_modules/diff/lib/diff/base.js
-var require_base = __commonJS({
- "node_modules/diff/lib/diff/base.js"(exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = Diff;
- function Diff() {
- }
- Diff.prototype = {
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- diff: function diff(oldString, newString) {
- var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var callback = options8.callback;
- if (typeof options8 === "function") {
- callback = options8;
- options8 = {};
- }
- this.options = options8;
- var self = this;
- function done(value) {
- if (callback) {
- setTimeout(function() {
- callback(void 0, value);
- }, 0);
- return true;
- } else {
- return value;
- }
- }
- oldString = this.castInput(oldString);
- newString = this.castInput(newString);
- oldString = this.removeEmpty(this.tokenize(oldString));
- newString = this.removeEmpty(this.tokenize(newString));
- var newLen = newString.length, oldLen = oldString.length;
- var editLength = 1;
- var maxEditLength = newLen + oldLen;
- if (options8.maxEditLength) {
- maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
- }
- var bestPath = [{
- newPos: -1,
- components: []
- }];
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
- return done([{
- value: this.join(newString),
- count: newString.length
- }]);
- }
- function execEditLength() {
- for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
- var basePath = (
- /*istanbul ignore start*/
- void 0
- );
- var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
- if (addPath) {
- bestPath[diagonalPath - 1] = void 0;
- }
- var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
- if (!canAdd && !canRemove) {
- bestPath[diagonalPath] = void 0;
- continue;
- }
- if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
- basePath = clonePath(removePath);
- self.pushComponent(basePath.components, void 0, true);
- } else {
- basePath = addPath;
- basePath.newPos++;
- self.pushComponent(basePath.components, true, void 0);
- }
- _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
- if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
- return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
- } else {
- bestPath[diagonalPath] = basePath;
- }
- }
- editLength++;
- }
- if (callback) {
- (function exec() {
- setTimeout(function() {
- if (editLength > maxEditLength) {
- return callback();
- }
- if (!execEditLength()) {
- exec();
- }
- }, 0);
- })();
- } else {
- while (editLength <= maxEditLength) {
- var ret = execEditLength();
- if (ret) {
- return ret;
- }
- }
- }
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- pushComponent: function pushComponent(components, added, removed) {
- var last = components[components.length - 1];
- if (last && last.added === added && last.removed === removed) {
- components[components.length - 1] = {
- count: last.count + 1,
- added,
- removed
- };
- } else {
- components.push({
- count: 1,
- added,
- removed
- });
- }
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
- var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
- newPos++;
- oldPos++;
- commonCount++;
- }
- if (commonCount) {
- basePath.components.push({
- count: commonCount
- });
- }
- basePath.newPos = newPos;
- return oldPos;
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- equals: function equals(left, right) {
- if (this.options.comparator) {
- return this.options.comparator(left, right);
- } else {
- return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
- }
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- removeEmpty: function removeEmpty(array2) {
- var ret = [];
- for (var i = 0; i < array2.length; i++) {
- if (array2[i]) {
- ret.push(array2[i]);
- }
- }
- return ret;
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- castInput: function castInput(value) {
- return value;
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- tokenize: function tokenize(value) {
- return value.split("");
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- join: function join2(chars) {
- return chars.join("");
- }
- };
- function buildValues(diff, components, newString, oldString, useLongestToken) {
- var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
- for (; componentPos < componentLen; componentPos++) {
- var component = components[componentPos];
- if (!component.removed) {
- if (!component.added && useLongestToken) {
- var value = newString.slice(newPos, newPos + component.count);
- value = value.map(function(value2, i) {
- var oldValue = oldString[oldPos + i];
- return oldValue.length > value2.length ? oldValue : value2;
- });
- component.value = diff.join(value);
- } else {
- component.value = diff.join(newString.slice(newPos, newPos + component.count));
- }
- newPos += component.count;
- if (!component.added) {
- oldPos += component.count;
- }
- } else {
- component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
- oldPos += component.count;
- if (componentPos && components[componentPos - 1].added) {
- var tmp = components[componentPos - 1];
- components[componentPos - 1] = components[componentPos];
- components[componentPos] = tmp;
- }
- }
- }
- var lastComponent = components[componentLen - 1];
- if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
- components[componentLen - 2].value += lastComponent.value;
- components.pop();
- }
- return components;
- }
- function clonePath(path13) {
- return {
- newPos: path13.newPos,
- components: path13.components.slice(0)
- };
- }
- }
-});
-
// node_modules/diff/lib/diff/array.js
var require_array2 = __commonJS({
"node_modules/diff/lib/diff/array.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -12936,10 +12108,11 @@
resolveConfig: () => resolveConfig,
resolveConfigFile: () => resolveConfigFile,
util: () => public_exports,
version: () => version_evaluate_default
});
+var import_create = __toESM(require_create(), 1);
var import_fast_glob = __toESM(require_out4(), 1);
// node_modules/vnopts/lib/descriptors/api.js
var apiDescriptor = {
key: (key2) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key2) ? key2 : JSON.stringify(key2),
@@ -12954,510 +12127,25 @@
return keys.length === 0 ? "{}" : `{ ${keys.map((key2) => `${apiDescriptor.key(key2)}: ${apiDescriptor.value(value[key2])}`).join(", ")} }`;
},
pair: ({ key: key2, value }) => apiDescriptor.value({ [key2]: value })
};
-// node_modules/chalk/source/vendor/ansi-styles/index.js
-var ANSI_BACKGROUND_OFFSET = 10;
-var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
-var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
-var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
-var styles = {
- modifier: {
- reset: [0, 0],
- // 21 isn't widely supported and 22 does the same thing
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- overline: [53, 55],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- // Bright color
- blackBright: [90, 39],
- gray: [90, 39],
- // Alias of `blackBright`
- grey: [90, 39],
- // Alias of `blackBright`
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- // Bright color
- bgBlackBright: [100, 49],
- bgGray: [100, 49],
- // Alias of `bgBlackBright`
- bgGrey: [100, 49],
- // Alias of `bgBlackBright`
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
-};
-var modifierNames = Object.keys(styles.modifier);
-var foregroundColorNames = Object.keys(styles.color);
-var backgroundColorNames = Object.keys(styles.bgColor);
-var colorNames = [...foregroundColorNames, ...backgroundColorNames];
-function assembleStyles() {
- const codes2 = /* @__PURE__ */ new Map();
- for (const [groupName, group] of Object.entries(styles)) {
- for (const [styleName, style] of Object.entries(group)) {
- styles[styleName] = {
- open: `\x1B[${style[0]}m`,
- close: `\x1B[${style[1]}m`
- };
- group[styleName] = styles[styleName];
- codes2.set(style[0], style[1]);
- }
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
- }
- Object.defineProperty(styles, "codes", {
- value: codes2,
- enumerable: false
- });
- styles.color.close = "\x1B[39m";
- styles.bgColor.close = "\x1B[49m";
- styles.color.ansi = wrapAnsi16();
- styles.color.ansi256 = wrapAnsi256();
- styles.color.ansi16m = wrapAnsi16m();
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
- Object.defineProperties(styles, {
- rgbToAnsi256: {
- value(red, green, blue) {
- if (red === green && green === blue) {
- if (red < 8) {
- return 16;
- }
- if (red > 248) {
- return 231;
- }
- return Math.round((red - 8) / 247 * 24) + 232;
- }
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
- },
- enumerable: false
- },
- hexToRgb: {
- value(hex) {
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
- if (!matches) {
- return [0, 0, 0];
- }
- let [colorString] = matches;
- if (colorString.length === 3) {
- colorString = [...colorString].map((character) => character + character).join("");
- }
- const integer = Number.parseInt(colorString, 16);
- return [
- /* eslint-disable no-bitwise */
- integer >> 16 & 255,
- integer >> 8 & 255,
- integer & 255
- /* eslint-enable no-bitwise */
- ];
- },
- enumerable: false
- },
- hexToAnsi256: {
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
- enumerable: false
- },
- ansi256ToAnsi: {
- value(code) {
- if (code < 8) {
- return 30 + code;
- }
- if (code < 16) {
- return 90 + (code - 8);
- }
- let red;
- let green;
- let blue;
- if (code >= 232) {
- red = ((code - 232) * 10 + 8) / 255;
- green = red;
- blue = red;
- } else {
- code -= 16;
- const remainder = code % 36;
- red = Math.floor(code / 36) / 5;
- green = Math.floor(remainder / 6) / 5;
- blue = remainder % 6 / 5;
- }
- const value = Math.max(red, green, blue) * 2;
- if (value === 0) {
- return 30;
- }
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
- if (value === 2) {
- result += 60;
- }
- return result;
- },
- enumerable: false
- },
- rgbToAnsi: {
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
- enumerable: false
- },
- hexToAnsi: {
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
- enumerable: false
- }
- });
- return styles;
-}
-var ansiStyles = assembleStyles();
-var ansi_styles_default = ansiStyles;
-
-// node_modules/chalk/source/vendor/supports-color/index.js
-import process2 from "process";
-import os from "os";
-import tty from "tty";
-function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
- const position = argv.indexOf(prefix + flag);
- const terminatorPosition = argv.indexOf("--");
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
-}
-var { env } = process2;
-var flagForceColor;
-if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
- flagForceColor = 0;
-} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
- flagForceColor = 1;
-}
-function envForceColor() {
- if ("FORCE_COLOR" in env) {
- if (env.FORCE_COLOR === "true") {
- return 1;
- }
- if (env.FORCE_COLOR === "false") {
- return 0;
- }
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
- }
-}
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
-}
-function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
- const noFlagForceColor = envForceColor();
- if (noFlagForceColor !== void 0) {
- flagForceColor = noFlagForceColor;
- }
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
- if (forceColor === 0) {
- return 0;
- }
- if (sniffFlags) {
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
- return 3;
- }
- if (hasFlag("color=256")) {
- return 2;
- }
- }
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
- return 1;
- }
- if (haveStream && !streamIsTTY && forceColor === void 0) {
- return 0;
- }
- const min = forceColor || 0;
- if (env.TERM === "dumb") {
- return min;
- }
- if (process2.platform === "win32") {
- const osRelease = os.release().split(".");
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
- return 1;
- }
- if ("CI" in env) {
- if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
- return 3;
- }
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") {
- return 1;
- }
- return min;
- }
- if ("TEAMCITY_VERSION" in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
- if (env.COLORTERM === "truecolor") {
- return 3;
- }
- if (env.TERM === "xterm-kitty") {
- return 3;
- }
- if ("TERM_PROGRAM" in env) {
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
- switch (env.TERM_PROGRAM) {
- case "iTerm.app": {
- return version >= 3 ? 3 : 2;
- }
- case "Apple_Terminal": {
- return 2;
- }
- }
- }
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
- if ("COLORTERM" in env) {
- return 1;
- }
- return min;
-}
-function createSupportsColor(stream, options8 = {}) {
- const level = _supportsColor(stream, {
- streamIsTTY: stream && stream.isTTY,
- ...options8
- });
- return translateLevel(level);
-}
-var supportsColor = {
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
-};
-var supports_color_default = supportsColor;
-
-// node_modules/chalk/source/utilities.js
-function stringReplaceAll(string, substring, replacer) {
- let index = string.indexOf(substring);
- if (index === -1) {
- return string;
- }
- const substringLength = substring.length;
- let endIndex = 0;
- let returnValue = "";
- do {
- returnValue += string.slice(endIndex, index) + substring + replacer;
- endIndex = index + substringLength;
- index = string.indexOf(substring, endIndex);
- } while (index !== -1);
- returnValue += string.slice(endIndex);
- return returnValue;
-}
-function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
- let endIndex = 0;
- let returnValue = "";
- do {
- const gotCR = string[index - 1] === "\r";
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
- endIndex = index + 1;
- index = string.indexOf("\n", endIndex);
- } while (index !== -1);
- returnValue += string.slice(endIndex);
- return returnValue;
-}
-
-// node_modules/chalk/source/index.js
-var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
-var GENERATOR = Symbol("GENERATOR");
-var STYLER = Symbol("STYLER");
-var IS_EMPTY = Symbol("IS_EMPTY");
-var levelMapping = [
- "ansi",
- "ansi",
- "ansi256",
- "ansi16m"
-];
-var styles2 = /* @__PURE__ */ Object.create(null);
-var applyOptions = (object, options8 = {}) => {
- if (options8.level && !(Number.isInteger(options8.level) && options8.level >= 0 && options8.level <= 3)) {
- throw new Error("The `level` option should be an integer from 0 to 3");
- }
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
- object.level = options8.level === void 0 ? colorLevel : options8.level;
-};
-var chalkFactory = (options8) => {
- const chalk2 = (...strings) => strings.join(" ");
- applyOptions(chalk2, options8);
- Object.setPrototypeOf(chalk2, createChalk.prototype);
- return chalk2;
-};
-function createChalk(options8) {
- return chalkFactory(options8);
-}
-Object.setPrototypeOf(createChalk.prototype, Function.prototype);
-for (const [styleName, style] of Object.entries(ansi_styles_default)) {
- styles2[styleName] = {
- get() {
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
- Object.defineProperty(this, styleName, { value: builder });
- return builder;
- }
- };
-}
-styles2.visible = {
- get() {
- const builder = createBuilder(this, this[STYLER], true);
- Object.defineProperty(this, "visible", { value: builder });
- return builder;
- }
-};
-var getModelAnsi = (model, level, type2, ...arguments_) => {
- if (model === "rgb") {
- if (level === "ansi16m") {
- return ansi_styles_default[type2].ansi16m(...arguments_);
- }
- if (level === "ansi256") {
- return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
- }
- return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
- }
- if (model === "hex") {
- return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_));
- }
- return ansi_styles_default[type2][model](...arguments_);
-};
-var usedModels = ["rgb", "hex", "ansi256"];
-for (const model of usedModels) {
- styles2[model] = {
- get() {
- const { level } = this;
- return function(...arguments_) {
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
- return createBuilder(this, styler, this[IS_EMPTY]);
- };
- }
- };
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
- styles2[bgModel] = {
- get() {
- const { level } = this;
- return function(...arguments_) {
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
- return createBuilder(this, styler, this[IS_EMPTY]);
- };
- }
- };
-}
-var proto = Object.defineProperties(() => {
-}, {
- ...styles2,
- level: {
- enumerable: true,
- get() {
- return this[GENERATOR].level;
- },
- set(level) {
- this[GENERATOR].level = level;
- }
- }
-});
-var createStyler = (open, close, parent) => {
- let openAll;
- let closeAll;
- if (parent === void 0) {
- openAll = open;
- closeAll = close;
- } else {
- openAll = parent.openAll + open;
- closeAll = close + parent.closeAll;
- }
- return {
- open,
- close,
- openAll,
- closeAll,
- parent
- };
-};
-var createBuilder = (self, _styler, _isEmpty) => {
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
- Object.setPrototypeOf(builder, proto);
- builder[GENERATOR] = self;
- builder[STYLER] = _styler;
- builder[IS_EMPTY] = _isEmpty;
- return builder;
-};
-var applyStyle = (self, string) => {
- if (self.level <= 0 || !string) {
- return self[IS_EMPTY] ? "" : string;
- }
- let styler = self[STYLER];
- if (styler === void 0) {
- return string;
- }
- const { openAll, closeAll } = styler;
- if (string.includes("\x1B")) {
- while (styler !== void 0) {
- string = stringReplaceAll(string, styler.close, styler.open);
- styler = styler.parent;
- }
- }
- const lfIndex = string.indexOf("\n");
- if (lfIndex !== -1) {
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
- }
- return openAll + string + closeAll;
-};
-Object.defineProperties(createChalk.prototype, styles2);
-var chalk = createChalk();
-var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
-var source_default = chalk;
-
// node_modules/vnopts/lib/handlers/deprecated/common.js
+init_source();
var commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => {
const messages2 = [
`${source_default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated`
];
if (redirectTo) {
messages2.push(`we now treat it as ${source_default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`);
}
return messages2.join("; ") + ".";
};
+// node_modules/vnopts/lib/handlers/invalid/common.js
+init_source();
+
// node_modules/vnopts/lib/constants.js
var VALUE_NOT_EXIST = Symbol.for("vnopts.VALUE_NOT_EXIST");
var VALUE_UNCHANGED = Symbol.for("vnopts.VALUE_UNCHANGED");
// node_modules/vnopts/lib/handlers/invalid/common.js
@@ -13497,10 +12185,13 @@
const [firstDescription, secondDescription] = descriptions;
const [firstWidth, secondWidth] = descriptions.map((description) => description.split("\n", 1)[0].length);
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
}
+// node_modules/vnopts/lib/handlers/unknown/leven.js
+init_source();
+
// node_modules/leven/index.js
var array = [];
var characterCodeCache = [];
function leven(first, second) {
if (first === second) {
@@ -14193,24 +12884,24 @@
yield to;
}
var iterate_directory_up_default = iterateDirectoryUp;
// src/config/searcher.js
-var _names, _filter, _stopDirectory, _cache, _searchInDirectory, searchInDirectory_fn;
+var _names, _filter, _stopDirectory, _cache, _Searcher_instances, searchInDirectory_fn;
var Searcher = class {
/**
* @param {{
* names: string[],
* filter: (fileOrDirectory: {name: string, path: string}) => Promise<boolean>,
* stopDirectory?: string,
* }} param0
*/
constructor({ names, filter: filter2, stopDirectory }) {
- __privateAdd(this, _searchInDirectory);
- __privateAdd(this, _names, void 0);
- __privateAdd(this, _filter, void 0);
- __privateAdd(this, _stopDirectory, void 0);
+ __privateAdd(this, _Searcher_instances);
+ __privateAdd(this, _names);
+ __privateAdd(this, _filter);
+ __privateAdd(this, _stopDirectory);
__privateAdd(this, _cache, /* @__PURE__ */ new Map());
__privateSet(this, _names, names);
__privateSet(this, _filter, filter2);
__privateSet(this, _stopDirectory, stopDirectory);
}
@@ -14224,11 +12915,11 @@
for (const directory of iterate_directory_up_default(
startDirectory,
__privateGet(this, _stopDirectory)
)) {
searchedDirectories.push(directory);
- result = await __privateMethod(this, _searchInDirectory, searchInDirectory_fn).call(this, directory, shouldCache);
+ result = await __privateMethod(this, _Searcher_instances, searchInDirectory_fn).call(this, directory, shouldCache);
if (result) {
break;
}
}
for (const directory of searchedDirectories) {
@@ -14242,11 +12933,11 @@
};
_names = new WeakMap();
_filter = new WeakMap();
_stopDirectory = new WeakMap();
_cache = new WeakMap();
-_searchInDirectory = new WeakSet();
+_Searcher_instances = new WeakSet();
searchInDirectory_fn = async function(directory, shouldCache) {
const cache3 = __privateGet(this, _cache);
if (shouldCache && cache3.has(directory)) {
return cache3.get(directory);
}
@@ -14422,14 +13113,12 @@
}
function isObject(subject) {
return typeof subject === "object" && subject !== null;
}
function toArray(sequence) {
- if (Array.isArray(sequence))
- return sequence;
- else if (isNothing(sequence))
- return [];
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
return [sequence];
}
function extend(target, source2) {
var index, length, key2, sourceKeys;
if (source2) {
@@ -14465,12 +13154,11 @@
isNegativeZero: isNegativeZero_1,
extend: extend_1
};
function formatError(exception2, compact) {
var where = "", message = exception2.reason || "(unknown reason)";
- if (!exception2.mark)
- return message;
+ if (!exception2.mark) return message;
if (exception2.mark.name) {
where += 'in "' + exception2.mark.name + '" ';
}
where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
if (!compact && exception2.mark.snippet) {
@@ -14517,20 +13205,15 @@
function padStart(string, max) {
return common.repeat(" ", max - string.length) + string;
}
function makeSnippet(mark, options8) {
options8 = Object.create(options8 || null);
- if (!mark.buffer)
- return null;
- if (!options8.maxLength)
- options8.maxLength = 79;
- if (typeof options8.indent !== "number")
- options8.indent = 1;
- if (typeof options8.linesBefore !== "number")
- options8.linesBefore = 3;
- if (typeof options8.linesAfter !== "number")
- options8.linesAfter = 2;
+ if (!mark.buffer) return null;
+ if (!options8.maxLength) options8.maxLength = 79;
+ if (typeof options8.indent !== "number") options8.indent = 1;
+ if (typeof options8.linesBefore !== "number") options8.linesBefore = 3;
+ if (typeof options8.linesAfter !== "number") options8.linesAfter = 2;
var re = /\r?\n|\r|\0/g;
var lineStarts = [0];
var lineEnds = [];
var match;
var foundLineNo = -1;
@@ -14539,18 +13222,16 @@
lineStarts.push(match.index + match[0].length);
if (mark.position <= match.index && foundLineNo < 0) {
foundLineNo = lineStarts.length - 2;
}
}
- if (foundLineNo < 0)
- foundLineNo = lineStarts.length - 1;
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
var result = "", i, line3;
var lineNoLength = Math.min(mark.line + options8.linesAfter, lineEnds.length).toString().length;
var maxLineLength = options8.maxLength - (options8.indent + lineNoLength + 3);
for (i = 1; i <= options8.linesBefore; i++) {
- if (foundLineNo - i < 0)
- break;
+ if (foundLineNo - i < 0) break;
line3 = getLine(
mark.buffer,
lineStarts[foundLineNo - i],
lineEnds[foundLineNo - i],
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
@@ -14560,12 +13241,11 @@
}
line3 = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
result += common.repeat(" ", options8.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line3.str + "\n";
result += common.repeat("-", options8.indent + lineNoLength + 3 + line3.pos) + "^\n";
for (i = 1; i <= options8.linesAfter; i++) {
- if (foundLineNo + i >= lineEnds.length)
- break;
+ if (foundLineNo + i >= lineEnds.length) break;
line3 = getLine(
mark.buffer,
lineStarts[foundLineNo + i],
lineEnds[foundLineNo + i],
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
@@ -14680,14 +13360,12 @@
if (definition instanceof type) {
explicit.push(definition);
} else if (Array.isArray(definition)) {
explicit = explicit.concat(definition);
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
- if (definition.implicit)
- implicit = implicit.concat(definition.implicit);
- if (definition.explicit)
- explicit = explicit.concat(definition.explicit);
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
} else {
throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
}
implicit.forEach(function(type$1) {
if (!(type$1 instanceof type)) {
@@ -14738,12 +13416,11 @@
seq,
map
]
});
function resolveYamlNull(data) {
- if (data === null)
- return true;
+ if (data === null) return true;
var max = data.length;
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
}
function constructYamlNull() {
return null;
@@ -14774,12 +13451,11 @@
}
},
defaultStyle: "lowercase"
});
function resolveYamlBoolean(data) {
- if (data === null)
- return false;
+ if (data === null) return false;
var max = data.length;
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
}
function constructYamlBoolean(data) {
return data === "true" || data === "True" || data === "TRUE";
@@ -14813,96 +13489,79 @@
}
function isDecCode(c2) {
return 48 <= c2 && c2 <= 57;
}
function resolveYamlInteger(data) {
- if (data === null)
- return false;
+ if (data === null) return false;
var max = data.length, index = 0, hasDigits = false, ch;
- if (!max)
- return false;
+ if (!max) return false;
ch = data[index];
if (ch === "-" || ch === "+") {
ch = data[++index];
}
if (ch === "0") {
- if (index + 1 === max)
- return true;
+ if (index + 1 === max) return true;
ch = data[++index];
if (ch === "b") {
index++;
for (; index < max; index++) {
ch = data[index];
- if (ch === "_")
- continue;
- if (ch !== "0" && ch !== "1")
- return false;
+ if (ch === "_") continue;
+ if (ch !== "0" && ch !== "1") return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
if (ch === "x") {
index++;
for (; index < max; index++) {
ch = data[index];
- if (ch === "_")
- continue;
- if (!isHexCode(data.charCodeAt(index)))
- return false;
+ if (ch === "_") continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
if (ch === "o") {
index++;
for (; index < max; index++) {
ch = data[index];
- if (ch === "_")
- continue;
- if (!isOctCode(data.charCodeAt(index)))
- return false;
+ if (ch === "_") continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
}
- if (ch === "_")
- return false;
+ if (ch === "_") return false;
for (; index < max; index++) {
ch = data[index];
- if (ch === "_")
- continue;
+ if (ch === "_") continue;
if (!isDecCode(data.charCodeAt(index))) {
return false;
}
hasDigits = true;
}
- if (!hasDigits || ch === "_")
- return false;
+ if (!hasDigits || ch === "_") return false;
return true;
}
function constructYamlInteger(data) {
var value = data, sign2 = 1, ch;
if (value.indexOf("_") !== -1) {
value = value.replace(/_/g, "");
}
ch = value[0];
if (ch === "-" || ch === "+") {
- if (ch === "-")
- sign2 = -1;
+ if (ch === "-") sign2 = -1;
value = value.slice(1);
ch = value[0];
}
- if (value === "0")
- return 0;
+ if (value === "0") return 0;
if (ch === "0") {
- if (value[1] === "b")
- return sign2 * parseInt(value.slice(2), 2);
- if (value[1] === "x")
- return sign2 * parseInt(value.slice(2), 16);
- if (value[1] === "o")
- return sign2 * parseInt(value.slice(2), 8);
+ if (value[1] === "b") return sign2 * parseInt(value.slice(2), 2);
+ if (value[1] === "x") return sign2 * parseInt(value.slice(2), 16);
+ if (value[1] === "o") return sign2 * parseInt(value.slice(2), 8);
}
return sign2 * parseInt(value, 10);
}
function isInteger(object) {
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
@@ -14938,12 +13597,11 @@
var YAML_FLOAT_PATTERN = new RegExp(
// 2.5e4, 2.5 and integers
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
);
function resolveYamlFloat(data) {
- if (data === null)
- return false;
+ if (data === null) return false;
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
// Probably should update regexp & check speed
data[data.length - 1] === "_") {
return false;
}
@@ -15024,25 +13682,20 @@
);
var YAML_TIMESTAMP_REGEXP = new RegExp(
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
);
function resolveYamlTimestamp(data) {
- if (data === null)
- return false;
- if (YAML_DATE_REGEXP.exec(data) !== null)
- return true;
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
- return true;
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
return false;
}
function constructYamlTimestamp(data) {
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
match = YAML_DATE_REGEXP.exec(data);
- if (match === null)
- match = YAML_TIMESTAMP_REGEXP.exec(data);
- if (match === null)
- throw new Error("Date resolve error");
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+ if (match === null) throw new Error("Date resolve error");
year = +match[1];
month = +match[2] - 1;
day = +match[3];
if (!match[4]) {
return new Date(Date.UTC(year, month, day));
@@ -15059,16 +13712,14 @@
}
if (match[9]) {
tz_hour = +match[10];
tz_minute = +(match[11] || 0);
delta = (tz_hour * 60 + tz_minute) * 6e4;
- if (match[9] === "-")
- delta = -delta;
+ if (match[9] === "-") delta = -delta;
}
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
- if (delta)
- date.setTime(date.getTime() - delta);
+ if (delta) date.setTime(date.getTime() - delta);
return date;
}
function representYamlTimestamp(object) {
return object.toISOString();
}
@@ -15086,19 +13737,16 @@
kind: "scalar",
resolve: resolveYamlMerge
});
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
function resolveYamlBinary(data) {
- if (data === null)
- return false;
+ if (data === null) return false;
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
for (idx = 0; idx < max; idx++) {
code = map2.indexOf(data.charAt(idx));
- if (code > 64)
- continue;
- if (code < 0)
- return false;
+ if (code > 64) continue;
+ if (code < 0) return false;
bitlen += 6;
}
return bitlen % 8 === 0;
}
function constructYamlBinary(data) {
@@ -15165,32 +13813,25 @@
represent: representYamlBinary
});
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
var _toString$2 = Object.prototype.toString;
function resolveYamlOmap(data) {
- if (data === null)
- return true;
+ if (data === null) return true;
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
for (index = 0, length = object.length; index < length; index += 1) {
pair = object[index];
pairHasKey = false;
- if (_toString$2.call(pair) !== "[object Object]")
- return false;
+ if (_toString$2.call(pair) !== "[object Object]") return false;
for (pairKey in pair) {
if (_hasOwnProperty$3.call(pair, pairKey)) {
- if (!pairHasKey)
- pairHasKey = true;
- else
- return false;
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
}
}
- if (!pairHasKey)
- return false;
- if (objectKeys.indexOf(pairKey) === -1)
- objectKeys.push(pairKey);
- else
- return false;
+ if (!pairHasKey) return false;
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
}
return true;
}
function constructYamlOmap(data) {
return data !== null ? data : [];
@@ -15200,28 +13841,24 @@
resolve: resolveYamlOmap,
construct: constructYamlOmap
});
var _toString$1 = Object.prototype.toString;
function resolveYamlPairs(data) {
- if (data === null)
- return true;
+ if (data === null) return true;
var index, length, pair, keys, result, object = data;
result = new Array(object.length);
for (index = 0, length = object.length; index < length; index += 1) {
pair = object[index];
- if (_toString$1.call(pair) !== "[object Object]")
- return false;
+ if (_toString$1.call(pair) !== "[object Object]") return false;
keys = Object.keys(pair);
- if (keys.length !== 1)
- return false;
+ if (keys.length !== 1) return false;
result[index] = [keys[0], pair[keys[0]]];
}
return true;
}
function constructYamlPairs(data) {
- if (data === null)
- return [];
+ if (data === null) return [];
var index, length, pair, keys, result, object = data;
result = new Array(object.length);
for (index = 0, length = object.length; index < length; index += 1) {
pair = object[index];
keys = Object.keys(pair);
@@ -15234,17 +13871,15 @@
resolve: resolveYamlPairs,
construct: constructYamlPairs
});
var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function resolveYamlSet(data) {
- if (data === null)
- return true;
+ if (data === null) return true;
var key2, object = data;
for (key2 in object) {
if (_hasOwnProperty$2.call(object, key2)) {
- if (object[key2] !== null)
- return false;
+ if (object[key2] !== null) return false;
}
}
return true;
}
function constructYamlSet(data) {
@@ -15901,12 +14536,11 @@
}
return true;
}
function readBlockSequence(state, nodeIndent) {
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
- if (state.firstTabInLine !== -1)
- return false;
+ if (state.firstTabInLine !== -1) return false;
if (state.anchor !== null) {
state.anchorMap[state.anchor] = _result;
}
ch = state.input.charCodeAt(state.position);
while (ch !== 0) {
@@ -15950,12 +14584,11 @@
}
return false;
}
function readBlockMapping(state, nodeIndent, flowIndent) {
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
- if (state.firstTabInLine !== -1)
- return false;
+ if (state.firstTabInLine !== -1) return false;
if (state.anchor !== null) {
state.anchorMap[state.anchor] = _result;
}
ch = state.input.charCodeAt(state.position);
while (ch !== 0) {
@@ -16061,12 +14694,11 @@
return detected;
}
function readTagProperty(state) {
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
ch = state.input.charCodeAt(state.position);
- if (ch !== 33)
- return false;
+ if (ch !== 33) return false;
if (state.tag !== null) {
throwError(state, "duplication of a tag property");
}
ch = state.input.charCodeAt(++state.position);
if (ch === 60) {
@@ -16133,12 +14765,11 @@
return true;
}
function readAnchorProperty(state) {
var _position, ch;
ch = state.input.charCodeAt(state.position);
- if (ch !== 38)
- return false;
+ if (ch !== 38) return false;
if (state.anchor !== null) {
throwError(state, "duplication of an anchor property");
}
ch = state.input.charCodeAt(++state.position);
_position = state.position;
@@ -16152,12 +14783,11 @@
return true;
}
function readAlias(state) {
var _position, alias, ch;
ch = state.input.charCodeAt(state.position);
- if (ch !== 42)
- return false;
+ if (ch !== 42) return false;
ch = state.input.charCodeAt(++state.position);
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
ch = state.input.charCodeAt(++state.position);
}
@@ -16329,20 +14959,18 @@
do {
ch = state.input.charCodeAt(++state.position);
} while (ch !== 0 && !is_EOL(ch));
break;
}
- if (is_EOL(ch))
- break;
+ if (is_EOL(ch)) break;
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
ch = state.input.charCodeAt(++state.position);
}
directiveArgs.push(state.input.slice(_position, state.position));
}
- if (ch !== 0)
- readLineBreak(state);
+ if (ch !== 0) readLineBreak(state);
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
directiveHandlers[directiveName](state, directiveName, directiveArgs);
} else {
throwWarning(state, 'unknown document directive "' + directiveName + '"');
}
@@ -17354,11 +15982,11 @@
super();
__publicField(this, "name", "JSONError");
__publicField(this, "fileName");
__publicField(this, "codeFrame");
__publicField(this, "rawCodeFrame");
- __privateAdd(this, _message, void 0);
+ __privateAdd(this, _message);
__privateSet(this, _message, message);
(_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, _JSONError);
}
get message() {
const { fileName, codeFrame } = this;
@@ -17461,10 +16089,14 @@
}
async function loadConfigFromPackageJson(file) {
const { prettier } = await readJson(file);
return prettier;
}
+async function loadConfigFromPackageYaml(file) {
+ const { prettier } = await loadYaml(file);
+ return prettier;
+}
async function loadYaml(file) {
const content = await read_file_default(file);
try {
return load(content);
} catch (error) {
@@ -17506,10 +16138,11 @@
var loaders_default = loaders;
// src/config/prettier-config/config-searcher.js
var CONFIG_FILE_NAMES = [
"package.json",
+ "package.yaml",
".prettierrc",
".prettierrc.json",
".prettierrc.yaml",
".prettierrc.yml",
".prettierrc.json5",
@@ -17530,10 +16163,17 @@
return Boolean(await loadConfigFromPackageJson(file));
} catch {
return false;
}
}
+ if (name === "package.yaml") {
+ try {
+ return Boolean(await loadConfigFromPackageYaml(file));
+ } catch {
+ return false;
+ }
+ }
return true;
}
function getSearcher(stopDirectory) {
return new searcher_default({ names: CONFIG_FILE_NAMES, filter, stopDirectory });
}
@@ -17545,22 +16185,19 @@
// src/utils/import-from-file.js
import { pathToFileURL as pathToFileURL4 } from "url";
// node_modules/import-meta-resolve/lib/resolve.js
import assert3 from "assert";
-import { Stats, statSync, realpathSync } from "fs";
+import { statSync, realpathSync } from "fs";
import process3 from "process";
-import { URL as URL3, fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
+import { URL as URL2, fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "url";
import path6 from "path";
import { builtinModules } from "module";
// node_modules/import-meta-resolve/lib/get-format.js
-import { fileURLToPath as fileURLToPath4 } from "url";
+import { fileURLToPath as fileURLToPath3 } from "url";
-// node_modules/import-meta-resolve/lib/package-config.js
-import { URL as URL2, fileURLToPath as fileURLToPath3 } from "url";
-
// node_modules/import-meta-resolve/lib/package-json-reader.js
import fs5 from "fs";
import path5 from "path";
import { fileURLToPath as fileURLToPath2 } from "url";
@@ -17639,24 +16276,21 @@
if (types.length > 0) {
message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
types,
"or"
)}`;
- if (instances.length > 0 || other.length > 0)
- message += " or ";
+ if (instances.length > 0 || other.length > 0) message += " or ";
}
if (instances.length > 0) {
message += `an instance of ${formatList(instances, "or")}`;
- if (other.length > 0)
- message += " or ";
+ if (other.length > 0) message += " or ";
}
if (other.length > 0) {
if (other.length > 1) {
message += `one of ${formatList(other, "or")}`;
} else {
- if (other[0].toLowerCase() !== other[0])
- message += "an ";
+ if (other[0].toLowerCase() !== other[0]) message += "an ";
message += `${other[0]}`;
}
}
message += `. Received ${determineSpecificType(actual)}`;
return message;
@@ -17688,25 +16322,25 @@
Error
);
codes.ERR_INVALID_PACKAGE_TARGET = createError(
"ERR_INVALID_PACKAGE_TARGET",
/**
- * @param {string} pkgPath
+ * @param {string} packagePath
* @param {string} key
* @param {unknown} target
* @param {boolean} [isImport=false]
* @param {string} [base]
*/
- (pkgPath, key2, target, isImport = false, base = void 0) => {
- const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
+ (packagePath, key2, target, isImport = false, base = void 0) => {
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
if (key2 === ".") {
assert2(isImport === false);
- return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
}
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
target
- )} defined for '${key2}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
+ )} defined for '${key2}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
},
Error
);
codes.ERR_MODULE_NOT_FOUND = createError(
"ERR_MODULE_NOT_FOUND",
@@ -17738,34 +16372,39 @@
TypeError
);
codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
"ERR_PACKAGE_PATH_NOT_EXPORTED",
/**
- * @param {string} pkgPath
+ * @param {string} packagePath
* @param {string} subpath
* @param {string} [base]
*/
- (pkgPath, subpath, base = void 0) => {
+ (packagePath, subpath, base = void 0) => {
if (subpath === ".")
- return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
- return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
+ return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
},
Error
);
codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
"ERR_UNSUPPORTED_DIR_IMPORT",
"Directory import '%s' is not supported resolving ES modules imported from %s",
Error
);
+codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
+ "ERR_UNSUPPORTED_RESOLVE_REQUEST",
+ 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
+ TypeError
+);
codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
"ERR_UNKNOWN_FILE_EXTENSION",
/**
- * @param {string} ext
+ * @param {string} extension
* @param {string} path
*/
- (ext, path13) => {
- return `Unknown file extension "${ext}" for ${path13}`;
+ (extension, path13) => {
+ return `Unknown file extension "${extension}" for ${path13}`;
},
TypeError
);
codes.ERR_INVALID_ARG_VALUE = createError(
"ERR_INVALID_ARG_VALUE",
@@ -17784,24 +16423,22 @@
},
TypeError
// Note: extra classes have been shaken out.
// , RangeError
);
-function createError(sym, value, def) {
+function createError(sym, value, constructor) {
messages.set(sym, value);
- return makeNodeErrorWithCode(def, sym);
+ return makeNodeErrorWithCode(constructor, sym);
}
function makeNodeErrorWithCode(Base, key2) {
return NodeError;
- function NodeError(...args) {
+ function NodeError(...parameters) {
const limit = Error.stackTraceLimit;
- if (isErrorStackTraceLimitWritable())
- Error.stackTraceLimit = 0;
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
const error = new Base();
- if (isErrorStackTraceLimitWritable())
- Error.stackTraceLimit = limit;
- const message = getMessage(key2, args, error);
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
+ const message = getMessage(key2, parameters, error);
Object.defineProperties(error, {
// Note: no need to implement `kIsNodeError` symbol, would be hard,
// probably.
message: {
value: message,
@@ -17835,14 +16472,14 @@
if (desc === void 0) {
return Object.isExtensible(Error);
}
return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
}
-function hideStackFrames(fn) {
- const hidden = nodeInternalPrefix + fn.name;
- Object.defineProperty(fn, "name", { value: hidden });
- return fn;
+function hideStackFrames(wrappedFunction) {
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
+ return wrappedFunction;
}
var captureLargerStackTrace = hideStackFrames(
/**
* @param {Error} error
* @returns {Error}
@@ -17853,38 +16490,35 @@
if (stackTraceLimitIsWritable) {
userStackTraceLimit = Error.stackTraceLimit;
Error.stackTraceLimit = Number.POSITIVE_INFINITY;
}
Error.captureStackTrace(error);
- if (stackTraceLimitIsWritable)
- Error.stackTraceLimit = userStackTraceLimit;
+ if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
return error;
}
);
-function getMessage(key2, args, self) {
+function getMessage(key2, parameters, self) {
const message = messages.get(key2);
assert2(message !== void 0, "expected `message` to be found");
if (typeof message === "function") {
assert2(
- message.length <= args.length,
+ message.length <= parameters.length,
// Default options do not count.
- `Code: ${key2}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).`
+ `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
);
- return Reflect.apply(message, self, args);
+ return Reflect.apply(message, self, parameters);
}
const regex = /%[dfijoOs]/g;
let expectedLength = 0;
- while (regex.exec(message) !== null)
- expectedLength++;
+ while (regex.exec(message) !== null) expectedLength++;
assert2(
- expectedLength === args.length,
- `Code: ${key2}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
+ expectedLength === parameters.length,
+ `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
);
- if (args.length === 0)
- return message;
- args.unshift(message);
- return Reflect.apply(format, null, args);
+ if (parameters.length === 0) return message;
+ parameters.unshift(message);
+ return Reflect.apply(format, null, parameters);
}
function determineSpecificType(value) {
if (value === null || value === void 0) {
return String(value);
}
@@ -17906,12 +16540,10 @@
// node_modules/import-meta-resolve/lib/package-json-reader.js
var hasOwnProperty = {}.hasOwnProperty;
var { ERR_INVALID_PACKAGE_CONFIG } = codes;
var cache = /* @__PURE__ */ new Map();
-var reader = { read: read2 };
-var package_json_reader_default = reader;
function read2(jsonPath, { base, specifier }) {
const existing = cache.get(jsonPath);
if (existing) {
return existing;
}
@@ -17972,48 +16604,38 @@
}
}
cache.set(jsonPath, result);
return result;
}
-
-// node_modules/import-meta-resolve/lib/package-config.js
function getPackageScopeConfig(resolved) {
- let packageJSONUrl = new URL2("package.json", resolved);
+ let packageJSONUrl = new URL("package.json", resolved);
while (true) {
const packageJSONPath2 = packageJSONUrl.pathname;
if (packageJSONPath2.endsWith("node_modules/package.json")) {
break;
}
- const packageConfig = package_json_reader_default.read(
- fileURLToPath3(packageJSONUrl),
- { specifier: resolved }
- );
+ const packageConfig = read2(fileURLToPath2(packageJSONUrl), {
+ specifier: resolved
+ });
if (packageConfig.exists) {
return packageConfig;
}
const lastPackageJSONUrl = packageJSONUrl;
- packageJSONUrl = new URL2("../package.json", packageJSONUrl);
+ packageJSONUrl = new URL("../package.json", packageJSONUrl);
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
break;
}
}
- const packageJSONPath = fileURLToPath3(packageJSONUrl);
+ const packageJSONPath = fileURLToPath2(packageJSONUrl);
return {
pjsonPath: packageJSONPath,
exists: false,
- main: void 0,
- name: void 0,
- type: "none",
- exports: void 0,
- imports: void 0
+ type: "none"
};
}
-
-// node_modules/import-meta-resolve/lib/resolve-get-package-type.js
function getPackageType(url2) {
- const packageConfig = getPackageScopeConfig(url2);
- return packageConfig.type;
+ return getPackageScopeConfig(url2).type;
}
// node_modules/import-meta-resolve/lib/get-format.js
var { ERR_UNKNOWN_FILE_EXTENSION } = codes;
var hasOwnProperty2 = {}.hasOwnProperty;
@@ -18026,12 +16648,11 @@
".mjs": "module"
};
function mimeToFormat(mime) {
if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime))
return "module";
- if (mime === "application/json")
- return "json";
+ if (mime === "application/json") return "json";
return null;
}
var protocolHandlers = {
// @ts-expect-error: hush.
__proto__: null,
@@ -18062,33 +16683,32 @@
}
}
return "";
}
function getFileProtocolModuleFormat(url2, _context, ignoreErrors) {
- const ext = extname(url2);
- if (ext === ".js") {
+ const value = extname(url2);
+ if (value === ".js") {
const packageType = getPackageType(url2);
if (packageType !== "none") {
return packageType;
}
return "commonjs";
}
- if (ext === "") {
+ if (value === "") {
const packageType = getPackageType(url2);
if (packageType === "none" || packageType === "commonjs") {
return "commonjs";
}
return "module";
}
- const format3 = extensionFormatMap[ext];
- if (format3)
- return format3;
+ const format3 = extensionFormatMap[value];
+ if (format3) return format3;
if (ignoreErrors) {
return void 0;
}
- const filepath = fileURLToPath4(url2);
- throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
+ const filepath = fileURLToPath3(url2);
+ throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
}
function getHttpProtocolModuleFormat() {
}
function defaultGetFormatWithoutErrors(url2, context) {
const protocol = url2.protocol;
@@ -18130,55 +16750,55 @@
ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2,
ERR_INVALID_PACKAGE_TARGET,
ERR_MODULE_NOT_FOUND,
ERR_PACKAGE_IMPORT_NOT_DEFINED,
ERR_PACKAGE_PATH_NOT_EXPORTED,
- ERR_UNSUPPORTED_DIR_IMPORT
+ ERR_UNSUPPORTED_DIR_IMPORT,
+ ERR_UNSUPPORTED_RESOLVE_REQUEST
} = codes;
var own2 = {}.hasOwnProperty;
var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
var invalidPackageNameRegEx = /^\.|%|\\/;
var patternRegEx = /\*/g;
-var encodedSepRegEx = /%2f|%5c/i;
+var encodedSeparatorRegEx = /%2f|%5c/i;
var emittedPackageWarnings = /* @__PURE__ */ new Set();
var doubleSlashRegEx = /[/\\]{2}/;
function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
if (process3.noDeprecation) {
return;
}
- const pjsonPath = fileURLToPath5(packageJsonUrl);
+ const pjsonPath = fileURLToPath4(packageJsonUrl);
const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
process3.emitWarning(
- `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath5(base)}` : ""}.`,
+ `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}.`,
"DeprecationWarning",
"DEP0166"
);
}
function emitLegacyIndexDeprecation(url2, packageJsonUrl, base, main) {
if (process3.noDeprecation) {
return;
}
const format3 = defaultGetFormatWithoutErrors(url2, { parentURL: base.href });
- if (format3 !== "module")
- return;
- const urlPath = fileURLToPath5(url2.href);
- const pkgPath = fileURLToPath5(new URL3(".", packageJsonUrl));
- const basePath = fileURLToPath5(base);
+ if (format3 !== "module") return;
+ const urlPath = fileURLToPath4(url2.href);
+ const packagePath = fileURLToPath4(new URL2(".", packageJsonUrl));
+ const basePath = fileURLToPath4(base);
if (!main) {
process3.emitWarning(
- `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${urlPath.slice(
- pkgPath.length
+ `No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
+ packagePath.length
)}", imported from ${basePath}.
Default "index" lookups for the main are deprecated for ES modules.`,
"DeprecationWarning",
"DEP0151"
);
- } else if (path6.resolve(pkgPath, main) !== urlPath) {
+ } else if (path6.resolve(packagePath, main) !== urlPath) {
process3.emitWarning(
- `Package ${pkgPath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
- pkgPath.length
+ `Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
+ packagePath.length
)}", imported from ${basePath}.
Automatic extension resolution of the "main" field is deprecated for ES modules.`,
"DeprecationWarning",
"DEP0151"
);
@@ -18186,37 +16806,34 @@
}
function tryStatSync(path13) {
try {
return statSync(path13);
} catch {
- return new Stats();
}
}
function fileExists(url2) {
const stats = statSync(url2, { throwIfNoEntry: false });
const isFile2 = stats ? stats.isFile() : void 0;
return isFile2 === null || isFile2 === void 0 ? false : isFile2;
}
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
let guess;
if (packageConfig.main !== void 0) {
- guess = new URL3(packageConfig.main, packageJsonUrl);
- if (fileExists(guess))
- return guess;
+ guess = new URL2(packageConfig.main, packageJsonUrl);
+ if (fileExists(guess)) return guess;
const tries2 = [
`./${packageConfig.main}.js`,
`./${packageConfig.main}.json`,
`./${packageConfig.main}.node`,
`./${packageConfig.main}/index.js`,
`./${packageConfig.main}/index.json`,
`./${packageConfig.main}/index.node`
];
let i2 = -1;
while (++i2 < tries2.length) {
- guess = new URL3(tries2[i2], packageJsonUrl);
- if (fileExists(guess))
- break;
+ guess = new URL2(tries2[i2], packageJsonUrl);
+ if (fileExists(guess)) break;
guess = void 0;
}
if (guess) {
emitLegacyIndexDeprecation(
guess,
@@ -18228,35 +16845,34 @@
}
}
const tries = ["./index.js", "./index.json", "./index.node"];
let i = -1;
while (++i < tries.length) {
- guess = new URL3(tries[i], packageJsonUrl);
- if (fileExists(guess))
- break;
+ guess = new URL2(tries[i], packageJsonUrl);
+ if (fileExists(guess)) break;
guess = void 0;
}
if (guess) {
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
return guess;
}
throw new ERR_MODULE_NOT_FOUND(
- fileURLToPath5(new URL3(".", packageJsonUrl)),
- fileURLToPath5(base)
+ fileURLToPath4(new URL2(".", packageJsonUrl)),
+ fileURLToPath4(base)
);
}
function finalizeResolution(resolved, base, preserveSymlinks) {
- if (encodedSepRegEx.exec(resolved.pathname) !== null) {
+ if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
throw new ERR_INVALID_MODULE_SPECIFIER(
resolved.pathname,
'must not include encoded "/" or "\\" characters',
- fileURLToPath5(base)
+ fileURLToPath4(base)
);
}
let filePath;
try {
- filePath = fileURLToPath5(resolved);
+ filePath = fileURLToPath4(resolved);
} catch (error) {
const cause = (
/** @type {ErrnoException} */
error
);
@@ -18265,19 +16881,19 @@
throw cause;
}
const stats = tryStatSync(
filePath.endsWith("/") ? filePath.slice(-1) : filePath
);
- if (stats.isDirectory()) {
- const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath5(base));
+ if (stats && stats.isDirectory()) {
+ const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath4(base));
error.url = String(resolved);
throw error;
}
- if (!stats.isFile()) {
+ if (!stats || !stats.isFile()) {
const error = new ERR_MODULE_NOT_FOUND(
filePath || resolved.pathname,
- base && fileURLToPath5(base),
+ base && fileURLToPath4(base),
true
);
error.url = String(resolved);
throw error;
}
@@ -18291,47 +16907,47 @@
return resolved;
}
function importNotDefined(specifier, packageJsonUrl, base) {
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
specifier,
- packageJsonUrl && fileURLToPath5(new URL3(".", packageJsonUrl)),
- fileURLToPath5(base)
+ packageJsonUrl && fileURLToPath4(new URL2(".", packageJsonUrl)),
+ fileURLToPath4(base)
);
}
function exportsNotFound(subpath, packageJsonUrl, base) {
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
- fileURLToPath5(new URL3(".", packageJsonUrl)),
+ fileURLToPath4(new URL2(".", packageJsonUrl)),
subpath,
- base && fileURLToPath5(base)
+ base && fileURLToPath4(base)
);
}
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
- const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath5(packageJsonUrl)}`;
+ const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath4(packageJsonUrl)}`;
throw new ERR_INVALID_MODULE_SPECIFIER(
request,
reason,
- base && fileURLToPath5(base)
+ base && fileURLToPath4(base)
);
}
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
return new ERR_INVALID_PACKAGE_TARGET(
- fileURLToPath5(new URL3(".", packageJsonUrl)),
+ fileURLToPath4(new URL2(".", packageJsonUrl)),
subpath,
target,
internal,
- base && fileURLToPath5(base)
+ base && fileURLToPath4(base)
);
}
function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
if (subpath !== "" && !pattern && target[target.length - 1] !== "/")
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
if (!target.startsWith("./")) {
if (internal && !target.startsWith("../") && !target.startsWith("/")) {
let isURL2 = false;
try {
- new URL3(target);
+ new URL2(target);
isURL2 = true;
} catch {
}
if (!isURL2) {
const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(
@@ -18365,17 +16981,16 @@
}
} else {
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
}
}
- const resolved = new URL3(target, packageJsonUrl);
+ const resolved = new URL2(target, packageJsonUrl);
const resolvedPath = resolved.pathname;
- const packagePath = new URL3(".", packageJsonUrl).pathname;
+ const packagePath = new URL2(".", packageJsonUrl).pathname;
if (!resolvedPath.startsWith(packagePath))
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
- if (subpath === "")
- return resolved;
+ if (subpath === "") return resolved;
if (invalidSegmentRegEx.exec(subpath) !== null) {
const request = pattern ? match.replace("*", () => subpath) : match + subpath;
if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
if (!isPathMap) {
const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(
@@ -18396,24 +17011,23 @@
} else {
throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
}
}
if (pattern) {
- return new URL3(
+ return new URL2(
RegExpPrototypeSymbolReplace.call(
patternRegEx,
resolved.href,
() => subpath
)
);
}
- return new URL3(subpath, resolved);
+ return new URL2(subpath, resolved);
}
function isArrayIndex(key2) {
const keyNumber = Number(key2);
- if (`${keyNumber}` !== key2)
- return false;
+ if (`${keyNumber}` !== key2) return false;
return keyNumber >= 0 && keyNumber < 4294967295;
}
function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
if (typeof target === "string") {
return resolvePackageTargetString(
@@ -18428,12 +17042,11 @@
conditions
);
}
if (Array.isArray(target)) {
const targetList = target;
- if (targetList.length === 0)
- return null;
+ if (targetList.length === 0) return null;
let lastException;
let i = -1;
while (++i < targetList.length) {
const targetItem = targetList[i];
let resolveResult;
@@ -18453,16 +17066,14 @@
const exception2 = (
/** @type {ErrnoException} */
error
);
lastException = exception2;
- if (exception2.code === "ERR_INVALID_PACKAGE_TARGET")
- continue;
+ if (exception2.code === "ERR_INVALID_PACKAGE_TARGET") continue;
throw error;
}
- if (resolveResult === void 0)
- continue;
+ if (resolveResult === void 0) continue;
if (resolveResult === null) {
lastException = null;
continue;
}
return resolveResult;
@@ -18477,11 +17088,11 @@
let i = -1;
while (++i < keys.length) {
const key2 = keys[i];
if (isArrayIndex(key2)) {
throw new ERR_INVALID_PACKAGE_CONFIG2(
- fileURLToPath5(packageJsonUrl),
+ fileURLToPath4(packageJsonUrl),
base,
'"exports" cannot contain numeric property keys.'
);
}
}
@@ -18502,12 +17113,11 @@
pattern,
internal,
isPathMap,
conditions
);
- if (resolveResult === void 0)
- continue;
+ if (resolveResult === void 0) continue;
return resolveResult;
}
}
return null;
}
@@ -18521,26 +17131,24 @@
internal,
base
);
}
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
- if (typeof exports === "string" || Array.isArray(exports))
- return true;
- if (typeof exports !== "object" || exports === null)
- return false;
+ if (typeof exports === "string" || Array.isArray(exports)) return true;
+ if (typeof exports !== "object" || exports === null) return false;
const keys = Object.getOwnPropertyNames(exports);
let isConditionalSugar = false;
let i = 0;
- let j = -1;
- while (++j < keys.length) {
- const key2 = keys[j];
- const curIsConditionalSugar = key2 === "" || key2[0] !== ".";
+ let keyIndex = -1;
+ while (++keyIndex < keys.length) {
+ const key2 = keys[keyIndex];
+ const currentIsConditionalSugar = key2 === "" || key2[0] !== ".";
if (i++ === 0) {
- isConditionalSugar = curIsConditionalSugar;
- } else if (isConditionalSugar !== curIsConditionalSugar) {
+ isConditionalSugar = currentIsConditionalSugar;
+ } else if (isConditionalSugar !== currentIsConditionalSugar) {
throw new ERR_INVALID_PACKAGE_CONFIG2(
- fileURLToPath5(packageJsonUrl),
+ fileURLToPath4(packageJsonUrl),
base,
`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`
);
}
}
@@ -18548,16 +17156,15 @@
}
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
if (process3.noDeprecation) {
return;
}
- const pjsonPath = fileURLToPath5(pjsonUrl);
- if (emittedPackageWarnings.has(pjsonPath + "|" + match))
- return;
+ const pjsonPath = fileURLToPath4(pjsonUrl);
+ if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return;
emittedPackageWarnings.add(pjsonPath + "|" + match);
process3.emitWarning(
- `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath5(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
+ `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath4(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
"DeprecationWarning",
"DEP0155"
);
}
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
@@ -18634,28 +17241,22 @@
function patternKeyCompare(a, b) {
const aPatternIndex = a.indexOf("*");
const bPatternIndex = b.indexOf("*");
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
- if (baseLengthA > baseLengthB)
- return -1;
- if (baseLengthB > baseLengthA)
- return 1;
- if (aPatternIndex === -1)
- return 1;
- if (bPatternIndex === -1)
- return -1;
- if (a.length > b.length)
- return -1;
- if (b.length > a.length)
- return 1;
+ if (baseLengthA > baseLengthB) return -1;
+ if (baseLengthB > baseLengthA) return 1;
+ if (aPatternIndex === -1) return 1;
+ if (bPatternIndex === -1) return -1;
+ if (a.length > b.length) return -1;
+ if (b.length > a.length) return 1;
return 0;
}
function packageImportsResolve(name, base, conditions) {
if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
const reason = "is not a valid internal imports specifier name";
- throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath5(base));
+ throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath4(base));
}
let packageJsonUrl;
const packageConfig = getPackageScopeConfig(base);
if (packageConfig.exists) {
packageJsonUrl = pathToFileURL3(packageConfig.pjsonPath);
@@ -18735,19 +17336,19 @@
}
if (!validPackageName) {
throw new ERR_INVALID_MODULE_SPECIFIER(
specifier,
"is not a valid package name",
- fileURLToPath5(base)
+ fileURLToPath4(base)
);
}
const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
return { packageName, packageSubpath, isScoped };
}
function packageResolve(specifier, base, conditions) {
if (builtinModules.includes(specifier)) {
- return new URL3("node:" + specifier);
+ return new URL2("node:" + specifier);
}
const { packageName, packageSubpath, isScoped } = parsePackageName(
specifier,
base
);
@@ -18762,31 +17363,28 @@
base,
conditions
);
}
}
- let packageJsonUrl = new URL3(
+ let packageJsonUrl = new URL2(
"./node_modules/" + packageName + "/package.json",
base
);
- let packageJsonPath = fileURLToPath5(packageJsonUrl);
+ let packageJsonPath = fileURLToPath4(packageJsonUrl);
let lastPath;
do {
const stat = tryStatSync(packageJsonPath.slice(0, -13));
- if (!stat.isDirectory()) {
+ if (!stat || !stat.isDirectory()) {
lastPath = packageJsonPath;
- packageJsonUrl = new URL3(
+ packageJsonUrl = new URL2(
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
packageJsonUrl
);
- packageJsonPath = fileURLToPath5(packageJsonUrl);
+ packageJsonPath = fileURLToPath4(packageJsonUrl);
continue;
}
- const packageConfig2 = package_json_reader_default.read(packageJsonPath, {
- base,
- specifier
- });
+ const packageConfig2 = read2(packageJsonPath, { base, specifier });
if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
return packageExportsResolve(
packageJsonUrl,
packageSubpath,
packageConfig2,
@@ -18795,46 +17393,53 @@
);
}
if (packageSubpath === ".") {
return legacyMainResolve(packageJsonUrl, packageConfig2, base);
}
- return new URL3(packageSubpath, packageJsonUrl);
+ return new URL2(packageSubpath, packageJsonUrl);
} while (packageJsonPath.length !== lastPath.length);
- throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath5(base), false);
+ throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath4(base), false);
}
function isRelativeSpecifier(specifier) {
if (specifier[0] === ".") {
- if (specifier.length === 1 || specifier[1] === "/")
- return true;
+ if (specifier.length === 1 || specifier[1] === "/") return true;
if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) {
return true;
}
}
return false;
}
function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
- if (specifier === "")
- return false;
- if (specifier[0] === "/")
- return true;
+ if (specifier === "") return false;
+ if (specifier[0] === "/") return true;
return isRelativeSpecifier(specifier);
}
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
const protocol = base.protocol;
- const isRemote = protocol === "http:" || protocol === "https:";
+ const isData = protocol === "data:";
+ const isRemote = isData || protocol === "http:" || protocol === "https:";
let resolved;
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
- resolved = new URL3(specifier, base);
- } else if (!isRemote && specifier[0] === "#") {
+ try {
+ resolved = new URL2(specifier, base);
+ } catch (error_) {
+ const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
+ error.cause = error_;
+ throw error;
+ }
+ } else if (protocol === "file:" && specifier[0] === "#") {
resolved = packageImportsResolve(specifier, base, conditions);
} else {
try {
- resolved = new URL3(specifier);
- } catch {
- if (!isRemote) {
- resolved = packageResolve(specifier, base, conditions);
+ resolved = new URL2(specifier);
+ } catch (error_) {
+ if (isRemote && !builtinModules.includes(specifier)) {
+ const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
+ error.cause = error_;
+ throw error;
}
+ resolved = packageResolve(specifier, base, conditions);
}
}
assert3(resolved !== void 0, "expected to be defined");
if (resolved.protocol !== "file:") {
return resolved;
@@ -18893,34 +17498,39 @@
assert3(parentURL !== void 0, "expected `parentURL` to be defined");
throwIfInvalidParentURL(parentURL);
let parsedParentURL;
if (parentURL) {
try {
- parsedParentURL = new URL3(parentURL);
+ parsedParentURL = new URL2(parentURL);
} catch {
}
}
let parsed;
+ let protocol;
try {
- parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL3(specifier, parsedParentURL) : new URL3(specifier);
- const protocol = parsed.protocol;
+ parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL2(specifier, parsedParentURL) : new URL2(specifier);
+ protocol = parsed.protocol;
if (protocol === "data:") {
return { url: parsed.href, format: null };
}
} catch {
}
const maybeReturn = checkIfDisallowedImport(
specifier,
parsed,
parsedParentURL
);
- if (maybeReturn)
- return maybeReturn;
- if (parsed && parsed.protocol === "node:")
+ if (maybeReturn) return maybeReturn;
+ if (protocol === void 0 && parsed) {
+ protocol = parsed.protocol;
+ }
+ if (protocol === "node:") {
return { url: specifier };
+ }
+ if (parsed && parsed.protocol === "node:") return { url: specifier };
const conditions = getConditionsSet(context.conditions);
- const url2 = moduleResolve(specifier, new URL3(parentURL), conditions, false);
+ const url2 = moduleResolve(specifier, new URL2(parentURL), conditions, false);
return {
// Do NOT cast `url` to a string: that will work even when there are real
// problems, silencing them
url: url2.href,
format: defaultGetFormatWithoutErrors(url2, { parentURL })
@@ -18983,11 +17593,11 @@
var load_external_config_default = loadExternalConfig;
// src/config/prettier-config/load-config.js
async function loadConfig(configFile) {
const { base: fileName, ext: extension } = path7.parse(configFile);
- const load2 = fileName === "package.json" ? loadConfigFromPackageJson : loaders_default[extension];
+ const load2 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension];
if (!load2) {
throw new Error(
`No loader specified for extension "${extension || "noExt"}"`
);
}
@@ -19294,11 +17904,11 @@
return (config == null ? void 0 : config.parser) ?? infer_parser_default(options8, { physicalFile: file });
}
var get_file_info_default = getFileInfo;
// src/main/core.js
-var import_diff = __toESM(require_array2(), 1);
+var import_array = __toESM(require_array2(), 1);
// src/common/end-of-line.js
function guessEndOfLine(text) {
const index = text.indexOf("\r");
if (index >= 0) {
@@ -19739,19 +18349,10 @@
return width;
}
var get_string_width_default = getStringWidth;
// src/document/utils.js
-var getDocParts = (doc2) => {
- if (Array.isArray(doc2)) {
- return doc2;
- }
- if (doc2.type !== DOC_TYPE_FILL) {
- throw new Error(`Expect doc to be 'array' or '${DOC_TYPE_FILL}'.`);
- }
- return doc2.parts;
-};
function mapDoc(doc2, cb) {
if (typeof doc2 === "string") {
return cb(doc2);
}
const mapped = /* @__PURE__ */ new Map();
@@ -20119,30 +18720,29 @@
}
function trim(out) {
let trimCount = 0;
let cursorCount = 0;
let outIndex = out.length;
- outer:
- while (outIndex--) {
- const last = out[outIndex];
- if (last === CURSOR_PLACEHOLDER) {
- cursorCount++;
- continue;
+ outer: while (outIndex--) {
+ const last = out[outIndex];
+ if (last === CURSOR_PLACEHOLDER) {
+ cursorCount++;
+ continue;
+ }
+ if (false) {
+ throw new Error(`Unexpected value in trim: '${typeof last}'`);
+ }
+ for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) {
+ const char = last[charIndex];
+ if (char === " " || char === " ") {
+ trimCount++;
+ } else {
+ out[outIndex] = last.slice(0, charIndex + 1);
+ break outer;
}
- if (false) {
- throw new Error(`Unexpected value in trim: '${typeof last}'`);
- }
- for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) {
- const char = last[charIndex];
- if (char === " " || char === " ") {
- trimCount++;
- } else {
- out[outIndex] = last.slice(0, charIndex + 1);
- break outer;
- }
- }
}
+ }
if (trimCount > 0 || cursorCount > 0) {
out.length = outIndex + 1;
while (cursorCount-- > 0) {
out.push(CURSOR_PLACEHOLDER);
}
@@ -20166,18 +18766,19 @@
}
const {
mode,
doc: doc2
} = cmds.pop();
- switch (get_doc_type_default(doc2)) {
+ const docType = get_doc_type_default(doc2);
+ switch (docType) {
case DOC_TYPE_STRING:
out.push(doc2);
width -= get_string_width_default(doc2);
break;
case DOC_TYPE_ARRAY:
case DOC_TYPE_FILL: {
- const parts = getDocParts(doc2);
+ const parts = docType === DOC_TYPE_ARRAY ? doc2 : doc2.parts;
for (let i = parts.length - 1; i >= 0; i--) {
cmds.push({
mode,
doc: parts[i]
});
@@ -20588,15 +19189,14 @@
return size;
}
var get_alignment_size_default = getAlignmentSize;
// src/common/ast-path.js
-var _getNodeStackIndex, getNodeStackIndex_fn, _getAncestors, getAncestors_fn;
+var _AstPath_instances, getNodeStackIndex_fn, getAncestors_fn;
var AstPath = class {
constructor(value) {
- __privateAdd(this, _getNodeStackIndex);
- __privateAdd(this, _getAncestors);
+ __privateAdd(this, _AstPath_instances);
this.stack = [value];
}
/** @type {string | null} */
get key() {
const {
@@ -20687,11 +19287,11 @@
get root() {
return this.stack[0];
}
/** @type {object[]} */
get ancestors() {
- return [...__privateMethod(this, _getAncestors, getAncestors_fn).call(this)];
+ return [...__privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)];
}
// The name of the current property is always the penultimate element of
// this.stack, and always a string/number/symbol.
getName() {
const {
@@ -20719,11 +19319,11 @@
this.stack,
-1
);
}
getNode(count = 0) {
- const stackIndex = __privateMethod(this, _getNodeStackIndex, getNodeStackIndex_fn).call(this, count);
+ const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count);
return stackIndex === -1 ? null : this.stack[stackIndex];
}
getParentNode(count = 0) {
return this.getNode(count + 1);
}
@@ -20754,11 +19354,11 @@
} finally {
stack2.length = length;
}
}
callParent(callback, count = 0) {
- const stackIndex = __privateMethod(this, _getNodeStackIndex, getNodeStackIndex_fn).call(this, count + 1);
+ const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count + 1);
const parentValues = this.stack.splice(stackIndex + 1);
try {
return callback(this);
} finally {
this.stack.push(...parentValues);
@@ -20839,11 +19439,11 @@
* return the first matching ancestor. If no such node exists, returns undefined.
* @param {(node: any) => boolean} predicate
* @internal Unstable API. Don't use in plugins for now.
*/
findAncestor(predicate) {
- for (const node of __privateMethod(this, _getAncestors, getAncestors_fn).call(this)) {
+ for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) {
if (predicate(node)) {
return node;
}
}
}
@@ -20854,19 +19454,19 @@
* @param {(node: any) => boolean} predicate
* @returns {boolean}
* @internal Unstable API. Don't use in plugins for now.
*/
hasAncestor(predicate) {
- for (const node of __privateMethod(this, _getAncestors, getAncestors_fn).call(this)) {
+ for (const node of __privateMethod(this, _AstPath_instances, getAncestors_fn).call(this)) {
if (predicate(node)) {
return true;
}
}
return false;
}
};
-_getNodeStackIndex = new WeakSet();
+_AstPath_instances = new WeakSet();
getNodeStackIndex_fn = function(count) {
const {
stack: stack2
} = this;
for (let i = stack2.length - 1; i >= 0; i -= 2) {
@@ -20874,11 +19474,10 @@
return i;
}
}
return -1;
};
-_getAncestors = new WeakSet();
getAncestors_fn = function* () {
const {
stack: stack2
} = this;
for (let index = stack2.length - 3; index >= 0; index -= 2) {
@@ -21931,11 +20530,11 @@
} else {
parameters.validate = (value, schema2, utils) => value === void 0 || schema2.validate(value, utils);
}
if (optionInfo.redirect) {
handlers.redirect = (value) => !value ? void 0 : {
- to: {
+ to: typeof optionInfo.redirect === "string" ? optionInfo.redirect : {
key: optionInfo.redirect.option,
value: optionInfo.redirect.value
}
};
}
@@ -22353,34 +20952,34 @@
return ast;
}
const getVisitorKeys = create_get_visitor_keys_function_default(printerGetVisitorKeys);
const ignoredProperties = cleanFunction.ignoredProperties ?? /* @__PURE__ */ new Set();
return recurse(ast);
- function recurse(node, parent) {
- if (!(node !== null && typeof node === "object")) {
- return node;
+ function recurse(original, parent) {
+ if (!(original !== null && typeof original === "object")) {
+ return original;
}
- if (Array.isArray(node)) {
- return node.map((child) => recurse(child, parent)).filter(Boolean);
+ if (Array.isArray(original)) {
+ return original.map((child) => recurse(child, parent)).filter(Boolean);
}
- const newObj = {};
- const childrenKeys = new Set(getVisitorKeys(node));
- for (const key2 in node) {
- if (!Object.prototype.hasOwnProperty.call(node, key2) || ignoredProperties.has(key2)) {
+ const cloned = {};
+ const childrenKeys = new Set(getVisitorKeys(original));
+ for (const key2 in original) {
+ if (!Object.prototype.hasOwnProperty.call(original, key2) || ignoredProperties.has(key2)) {
continue;
}
if (childrenKeys.has(key2)) {
- newObj[key2] = recurse(node[key2], node);
+ cloned[key2] = recurse(original[key2], original);
} else {
- newObj[key2] = node[key2];
+ cloned[key2] = original[key2];
}
}
- const result = cleanFunction(node, newObj, parent);
+ const result = cleanFunction(original, cloned, parent);
if (result === null) {
return;
}
- return result ?? newObj;
+ return result ?? cloned;
}
}
var massage_ast_default = massageAst;
// src/main/range-util.js
@@ -22648,11 +21247,11 @@
};
}
const oldCursorNodeCharArray = oldCursorNodeText.split("");
oldCursorNodeCharArray.splice(cursorOffsetRelativeToOldCursorNode, 0, CURSOR);
const newCursorNodeCharArray = newCursorNodeText.split("");
- const cursorNodeDiff = (0, import_diff.diffArrays)(oldCursorNodeCharArray, newCursorNodeCharArray);
+ const cursorNodeDiff = (0, import_array.diffArrays)(oldCursorNodeCharArray, newCursorNodeCharArray);
let cursorOffset = newCursorNodeStart;
for (const entry of cursorNodeDiff) {
if (entry.removed) {
if (entry.value.includes(CURSOR)) {
break;
@@ -23954,11 +22553,11 @@
// src/index.js
import * as doc from "./doc.mjs";
// src/main/version.evaluate.cjs
-var version_evaluate_default = "3.2.5";
+var version_evaluate_default = "3.3.0";
// src/utils/public.js
var public_exports = {};
__export(public_exports, {
addDanglingComment: () => addDanglingComment,
@@ -24217,9 +22816,10 @@
vnopts: {
ChoiceSchema,
apiDescriptor
},
fastGlob: import_fast_glob.default,
+ createTwoFilesPatch: import_create.createTwoFilesPatch,
utils: {
isNonEmptyArray: is_non_empty_array_default,
partition: partition_default,
omit: object_omit_default
},