Bundle Pure ESM Packages into /vendors/*.js as CommonJS (#12217)
* string-width * Add bundle script * Update package.json * mem * Add version validator * Throw error * Change filename * Add documents * Generate d.ts * Fix lint problems * globby * Add workflow to validate vendor versions * Fix eslintignore * Fix * Fix spell * Address review * process.exitCode = 1 * test validation * Revert "test validation" This reverts commit 5a86d5f71212e0e900709238a8cc109716678864. * Remove exists files * Fix conflicts * Clean * Remove globby
This commit is contained in:
1 parent
6d036cf895
commit
0abd1907bb
21 files changed
+804
-27
No files matched your search
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
# `./vendors`
|
||||
|
||||
**JavaScript Files that included in this directory are auto generated by `scripts/vendor/bundle-vendors.mjs`.**
|
||||
Vendored
+278
@@ -0,0 +1,278 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __defProps = Object.defineProperties;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (__hasOwnProp.call(b, prop))
|
||||
__defNormalProp(a, prop, b[prop]);
|
||||
if (__getOwnPropSymbols)
|
||||
for (var prop of __getOwnPropSymbols(b)) {
|
||||
if (__propIsEnum.call(b, prop))
|
||||
__defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __reExport = (target, module2, copyDefault, desc) => {
|
||||
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
||||
for (let key of __getOwnPropNames(module2))
|
||||
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
||||
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
||||
}
|
||||
return target;
|
||||
};
|
||||
var __toESM = (module2, isNodeMode) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
||||
return (module2, temp) => {
|
||||
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
||||
};
|
||||
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
||||
|
||||
// node_modules/p-defer/index.js
|
||||
var require_p_defer = __commonJS({
|
||||
"node_modules/p-defer/index.js"(exports, module2) {
|
||||
"use strict";
|
||||
module2.exports = () => {
|
||||
const ret = {};
|
||||
ret.promise = new Promise((resolve, reject) => {
|
||||
ret.resolve = resolve;
|
||||
ret.reject = reject;
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/map-age-cleaner/dist/index.js
|
||||
var require_dist = __commonJS({
|
||||
"node_modules/map-age-cleaner/dist/index.js"(exports, module2) {
|
||||
"use strict";
|
||||
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function(resolve, reject) {
|
||||
function fulfilled(value) {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function rejected(value) {
|
||||
try {
|
||||
step(generator["throw"](value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function step(result) {
|
||||
result.done ? resolve(result.value) : new P(function(resolve2) {
|
||||
resolve2(result.value);
|
||||
}).then(fulfilled, rejected);
|
||||
}
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = exports && exports.__importDefault || function(mod) {
|
||||
return mod && mod.__esModule ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var p_defer_1 = __importDefault(require_p_defer());
|
||||
function mapAgeCleaner2(map, property = "maxAge") {
|
||||
let processingKey;
|
||||
let processingTimer;
|
||||
let processingDeferred;
|
||||
const cleanup = () => __awaiter(this, void 0, void 0, function* () {
|
||||
if (processingKey !== void 0) {
|
||||
return;
|
||||
}
|
||||
const setupTimer = (item) => __awaiter(this, void 0, void 0, function* () {
|
||||
processingDeferred = p_defer_1.default();
|
||||
const delay = item[1][property] - Date.now();
|
||||
if (delay <= 0) {
|
||||
map.delete(item[0]);
|
||||
processingDeferred.resolve();
|
||||
return;
|
||||
}
|
||||
processingKey = item[0];
|
||||
processingTimer = setTimeout(() => {
|
||||
map.delete(item[0]);
|
||||
if (processingDeferred) {
|
||||
processingDeferred.resolve();
|
||||
}
|
||||
}, delay);
|
||||
if (typeof processingTimer.unref === "function") {
|
||||
processingTimer.unref();
|
||||
}
|
||||
return processingDeferred.promise;
|
||||
});
|
||||
try {
|
||||
for (const entry of map) {
|
||||
yield setupTimer(entry);
|
||||
}
|
||||
} catch (_a) {
|
||||
}
|
||||
processingKey = void 0;
|
||||
});
|
||||
const reset = () => {
|
||||
processingKey = void 0;
|
||||
if (processingTimer !== void 0) {
|
||||
clearTimeout(processingTimer);
|
||||
processingTimer = void 0;
|
||||
}
|
||||
if (processingDeferred !== void 0) {
|
||||
processingDeferred.reject(void 0);
|
||||
processingDeferred = void 0;
|
||||
}
|
||||
};
|
||||
const originalSet = map.set.bind(map);
|
||||
map.set = (key, value) => {
|
||||
if (map.has(key)) {
|
||||
map.delete(key);
|
||||
}
|
||||
const result = originalSet(key, value);
|
||||
if (processingKey && processingKey === key) {
|
||||
reset();
|
||||
}
|
||||
cleanup();
|
||||
return result;
|
||||
};
|
||||
cleanup();
|
||||
return map;
|
||||
}
|
||||
exports.default = mapAgeCleaner2;
|
||||
module2.exports = mapAgeCleaner2;
|
||||
module2.exports.default = mapAgeCleaner2;
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/mem/dist/index.js
|
||||
var dist_exports = {};
|
||||
__export(dist_exports, {
|
||||
default: () => mem,
|
||||
memClear: () => memClear,
|
||||
memDecorator: () => memDecorator
|
||||
});
|
||||
|
||||
// node_modules/mimic-fn/index.js
|
||||
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
||||
if (property === "length" || property === "prototype") {
|
||||
return;
|
||||
}
|
||||
if (property === "arguments" || property === "caller") {
|
||||
return;
|
||||
}
|
||||
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
||||
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
||||
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
||||
return;
|
||||
}
|
||||
Object.defineProperty(to, property, fromDescriptor);
|
||||
};
|
||||
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
||||
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
||||
};
|
||||
var changePrototype = (to, from) => {
|
||||
const fromPrototype = Object.getPrototypeOf(from);
|
||||
if (fromPrototype === Object.getPrototypeOf(to)) {
|
||||
return;
|
||||
}
|
||||
Object.setPrototypeOf(to, fromPrototype);
|
||||
};
|
||||
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
||||
${fromBody}`;
|
||||
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
||||
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
||||
var changeToString = (to, from, name) => {
|
||||
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
||||
const newToString = wrappedToString.bind(null, withName, from.toString());
|
||||
Object.defineProperty(newToString, "name", toStringName);
|
||||
Object.defineProperty(to, "toString", __spreadProps(__spreadValues({}, toStringDescriptor), { value: newToString }));
|
||||
};
|
||||
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
||||
const { name } = to;
|
||||
for (const property of Reflect.ownKeys(from)) {
|
||||
copyProperty(to, from, property, ignoreNonConfigurable);
|
||||
}
|
||||
changePrototype(to, from);
|
||||
changeToString(to, from, name);
|
||||
return to;
|
||||
}
|
||||
|
||||
// node_modules/mem/dist/index.js
|
||||
var import_map_age_cleaner = __toESM(require_dist(), 1);
|
||||
var cacheStore = /* @__PURE__ */ new WeakMap();
|
||||
function mem(fn, { cacheKey, cache = /* @__PURE__ */ new Map(), maxAge } = {}) {
|
||||
if (typeof maxAge === "number") {
|
||||
(0, import_map_age_cleaner.default)(cache);
|
||||
}
|
||||
const memoized = function(...arguments_) {
|
||||
const key = cacheKey ? cacheKey(arguments_) : arguments_[0];
|
||||
const cacheItem = cache.get(key);
|
||||
if (cacheItem) {
|
||||
return cacheItem.data;
|
||||
}
|
||||
const result = fn.apply(this, arguments_);
|
||||
cache.set(key, {
|
||||
data: result,
|
||||
maxAge: maxAge ? Date.now() + maxAge : Number.POSITIVE_INFINITY
|
||||
});
|
||||
return result;
|
||||
};
|
||||
mimicFunction(memoized, fn, {
|
||||
ignoreNonConfigurable: true
|
||||
});
|
||||
cacheStore.set(memoized, cache);
|
||||
return memoized;
|
||||
}
|
||||
function memDecorator(options = {}) {
|
||||
const instanceMap = /* @__PURE__ */ new WeakMap();
|
||||
return (target, propertyKey, descriptor) => {
|
||||
const input = target[propertyKey];
|
||||
if (typeof input !== "function") {
|
||||
throw new TypeError("The decorated value must be a function");
|
||||
}
|
||||
delete descriptor.value;
|
||||
delete descriptor.writable;
|
||||
descriptor.get = function() {
|
||||
if (!instanceMap.has(this)) {
|
||||
const value = mem(input, options);
|
||||
instanceMap.set(this, value);
|
||||
return value;
|
||||
}
|
||||
return instanceMap.get(this);
|
||||
};
|
||||
};
|
||||
}
|
||||
function memClear(fn) {
|
||||
const cache = cacheStore.get(fn);
|
||||
if (!cache) {
|
||||
throw new TypeError("Can't clear a function that was not memoized!");
|
||||
}
|
||||
if (typeof cache.clear !== "function") {
|
||||
throw new TypeError("The cache Map can't be cleared!");
|
||||
}
|
||||
cache.clear();
|
||||
}
|
||||
module.exports = __toCommonJS(dist_exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
memClear,
|
||||
memDecorator
|
||||
});
|
||||
Vendored
+102
@@ -0,0 +1,102 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __reExport = (target, module2, copyDefault, desc) => {
|
||||
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
||||
for (let key of __getOwnPropNames(module2))
|
||||
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
||||
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
||||
}
|
||||
return target;
|
||||
};
|
||||
var __toESM = (module2, isNodeMode) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
||||
return (module2, temp) => {
|
||||
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
||||
};
|
||||
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
||||
|
||||
// node_modules/emoji-regex/index.js
|
||||
var require_emoji_regex = __commonJS({
|
||||
"node_modules/emoji-regex/index.js"(exports, module2) {
|
||||
"use strict";
|
||||
module2.exports = function() {
|
||||
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDLine truncated
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/string-width/index.js
|
||||
var string_width_exports = {};
|
||||
__export(string_width_exports, {
|
||||
default: () => stringWidth
|
||||
});
|
||||
|
||||
// node_modules/string-width/node_modules/ansi-regex/index.js
|
||||
function ansiRegex({ onlyFirst = false } = {}) {
|
||||
const pattern = [
|
||||
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
||||
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
||||
].join("|");
|
||||
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
||||
}
|
||||
|
||||
// node_modules/string-width/node_modules/strip-ansi/index.js
|
||||
function stripAnsi(string) {
|
||||
if (typeof string !== "string") {
|
||||
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
||||
}
|
||||
return string.replace(ansiRegex(), "");
|
||||
}
|
||||
|
||||
// node_modules/is-fullwidth-code-point/index.js
|
||||
function isFullwidthCodePoint(codePoint) {
|
||||
if (!Number.isInteger(codePoint)) {
|
||||
return false;
|
||||
}
|
||||
return codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141);
|
||||
}
|
||||
|
||||
// node_modules/string-width/index.js
|
||||
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
||||
function stringWidth(string) {
|
||||
if (typeof string !== "string" || string.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
string = stripAnsi(string);
|
||||
if (string.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
string = string.replace((0, import_emoji_regex.default)(), " ");
|
||||
let width = 0;
|
||||
for (let index = 0; index < string.length; index++) {
|
||||
const codePoint = string.codePointAt(index);
|
||||
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
||||
continue;
|
||||
}
|
||||
if (codePoint >= 768 && codePoint <= 879) {
|
||||
continue;
|
||||
}
|
||||
if (codePoint > 65535) {
|
||||
index++;
|
||||
}
|
||||
width += isFullwidthCodePoint(codePoint) ? 2 : 1;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
module.exports = __toCommonJS(string_width_exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {});
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
// This file is generate automatically.
|
||||
declare module "#string-width";
|
||||
declare module "#mem";
|
||||
Reference in new issue
Block a user