vite-plugin-vue-devtools 7.4.4 → 7.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/assets/index-Ba1A_el2.css +1 -0
- package/client/assets/index-BtmHFqwF.js +1092 -0
- package/client/index.html +2 -2
- package/dist/vite.cjs +225 -225
- package/dist/vite.mjs +224 -224
- package/package.json +5 -5
- package/src/overlay/devtools-overlay.css +1 -1
- package/src/overlay/devtools-overlay.mjs +5 -5
- package/src/overlay.js +1 -1
- package/client/assets/index-C5B0ozEB.css +0 -1
- package/client/assets/index-DQiClRQr.js +0 -1092
package/client/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<link rel="icon" href="./logo.svg" type="image/svg+xml" />
|
|
7
7
|
<title>Vue DevTools Client</title>
|
|
8
8
|
<script src="./color-scheme.js"></script>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-BtmHFqwF.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Ba1A_el2.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="app"></div>
|
package/dist/vite.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const node_url = require('node:url');
|
|
4
|
-
const path$a = require('node:path');
|
|
5
3
|
const fs$8 = require('node:fs');
|
|
6
|
-
const
|
|
4
|
+
const path$a = require('node:path');
|
|
5
|
+
const node_url = require('node:url');
|
|
6
|
+
const devtoolsCore = require('@vue/devtools-core');
|
|
7
|
+
const devtoolsKit = require('@vue/devtools-kit');
|
|
7
8
|
const sirv = require('sirv');
|
|
9
|
+
const vite = require('vite');
|
|
8
10
|
const Inspect = require('vite-plugin-inspect');
|
|
9
|
-
const devtoolsKit = require('@vue/devtools-kit');
|
|
10
11
|
const VueInspector = require('vite-plugin-vue-inspector');
|
|
11
|
-
const devtoolsCore = require('@vue/devtools-core');
|
|
12
12
|
const fsp = require('node:fs/promises');
|
|
13
13
|
const require$$0 = require('os');
|
|
14
14
|
const require$$0$1 = require('path');
|
|
@@ -19,8 +19,8 @@ const require$$0$4 = require('fs');
|
|
|
19
19
|
|
|
20
20
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
21
21
|
|
|
22
|
-
const path__default = /*#__PURE__*/_interopDefaultCompat(path$a);
|
|
23
22
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs$8);
|
|
23
|
+
const path__default = /*#__PURE__*/_interopDefaultCompat(path$a);
|
|
24
24
|
const sirv__default = /*#__PURE__*/_interopDefaultCompat(sirv);
|
|
25
25
|
const Inspect__default = /*#__PURE__*/_interopDefaultCompat(Inspect);
|
|
26
26
|
const VueInspector__default = /*#__PURE__*/_interopDefaultCompat(VueInspector);
|
|
@@ -115,62 +115,6 @@ const cyan = kolorist(36, 39);
|
|
|
115
115
|
const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : path$a.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('vite.cjs', document.baseURI).href))));
|
|
116
116
|
const DIR_CLIENT = path$a.resolve(DIR_DIST, "../client");
|
|
117
117
|
|
|
118
|
-
const DEBOUNCE_DEFAULTS = {
|
|
119
|
-
trailing: true
|
|
120
|
-
};
|
|
121
|
-
function debounce(fn, wait = 25, options = {}) {
|
|
122
|
-
options = { ...DEBOUNCE_DEFAULTS, ...options };
|
|
123
|
-
if (!Number.isFinite(wait)) {
|
|
124
|
-
throw new TypeError("Expected `wait` to be a finite number");
|
|
125
|
-
}
|
|
126
|
-
let leadingValue;
|
|
127
|
-
let timeout;
|
|
128
|
-
let resolveList = [];
|
|
129
|
-
let currentPromise;
|
|
130
|
-
let trailingArgs;
|
|
131
|
-
const applyFn = (_this, args) => {
|
|
132
|
-
currentPromise = _applyPromised(fn, _this, args);
|
|
133
|
-
currentPromise.finally(() => {
|
|
134
|
-
currentPromise = null;
|
|
135
|
-
if (options.trailing && trailingArgs && !timeout) {
|
|
136
|
-
const promise = applyFn(_this, trailingArgs);
|
|
137
|
-
trailingArgs = null;
|
|
138
|
-
return promise;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return currentPromise;
|
|
142
|
-
};
|
|
143
|
-
return function(...args) {
|
|
144
|
-
if (currentPromise) {
|
|
145
|
-
if (options.trailing) {
|
|
146
|
-
trailingArgs = args;
|
|
147
|
-
}
|
|
148
|
-
return currentPromise;
|
|
149
|
-
}
|
|
150
|
-
return new Promise((resolve) => {
|
|
151
|
-
const shouldCallNow = !timeout && options.leading;
|
|
152
|
-
clearTimeout(timeout);
|
|
153
|
-
timeout = setTimeout(() => {
|
|
154
|
-
timeout = null;
|
|
155
|
-
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
156
|
-
for (const _resolve of resolveList) {
|
|
157
|
-
_resolve(promise);
|
|
158
|
-
}
|
|
159
|
-
resolveList = [];
|
|
160
|
-
}, wait);
|
|
161
|
-
if (shouldCallNow) {
|
|
162
|
-
leadingValue = applyFn(this, args);
|
|
163
|
-
resolve(leadingValue);
|
|
164
|
-
} else {
|
|
165
|
-
resolveList.push(resolve);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
async function _applyPromised(fn, _this, args) {
|
|
171
|
-
return await fn.apply(_this, args);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
118
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
175
119
|
|
|
176
120
|
function getDefaultExportFromCjs (x) {
|
|
@@ -6893,169 +6837,6 @@ var out = FastGlob;
|
|
|
6893
6837
|
|
|
6894
6838
|
const fg = /*@__PURE__*/getDefaultExportFromCjs(out);
|
|
6895
6839
|
|
|
6896
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
6897
|
-
function normalizeWindowsPath(input = "") {
|
|
6898
|
-
if (!input) {
|
|
6899
|
-
return input;
|
|
6900
|
-
}
|
|
6901
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6902
|
-
}
|
|
6903
|
-
|
|
6904
|
-
const _UNC_REGEX = /^[/\\]{2}/;
|
|
6905
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
6906
|
-
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
6907
|
-
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
6908
|
-
const normalize = function(path) {
|
|
6909
|
-
if (path.length === 0) {
|
|
6910
|
-
return ".";
|
|
6911
|
-
}
|
|
6912
|
-
path = normalizeWindowsPath(path);
|
|
6913
|
-
const isUNCPath = path.match(_UNC_REGEX);
|
|
6914
|
-
const isPathAbsolute = isAbsolute(path);
|
|
6915
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
6916
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
6917
|
-
if (path.length === 0) {
|
|
6918
|
-
if (isPathAbsolute) {
|
|
6919
|
-
return "/";
|
|
6920
|
-
}
|
|
6921
|
-
return trailingSeparator ? "./" : ".";
|
|
6922
|
-
}
|
|
6923
|
-
if (trailingSeparator) {
|
|
6924
|
-
path += "/";
|
|
6925
|
-
}
|
|
6926
|
-
if (_DRIVE_LETTER_RE.test(path)) {
|
|
6927
|
-
path += "/";
|
|
6928
|
-
}
|
|
6929
|
-
if (isUNCPath) {
|
|
6930
|
-
if (!isPathAbsolute) {
|
|
6931
|
-
return `//./${path}`;
|
|
6932
|
-
}
|
|
6933
|
-
return `//${path}`;
|
|
6934
|
-
}
|
|
6935
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
6936
|
-
};
|
|
6937
|
-
const join = function(...arguments_) {
|
|
6938
|
-
if (arguments_.length === 0) {
|
|
6939
|
-
return ".";
|
|
6940
|
-
}
|
|
6941
|
-
let joined;
|
|
6942
|
-
for (const argument of arguments_) {
|
|
6943
|
-
if (argument && argument.length > 0) {
|
|
6944
|
-
if (joined === void 0) {
|
|
6945
|
-
joined = argument;
|
|
6946
|
-
} else {
|
|
6947
|
-
joined += `/${argument}`;
|
|
6948
|
-
}
|
|
6949
|
-
}
|
|
6950
|
-
}
|
|
6951
|
-
if (joined === void 0) {
|
|
6952
|
-
return ".";
|
|
6953
|
-
}
|
|
6954
|
-
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
6955
|
-
};
|
|
6956
|
-
function cwd() {
|
|
6957
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
6958
|
-
return process.cwd().replace(/\\/g, "/");
|
|
6959
|
-
}
|
|
6960
|
-
return "/";
|
|
6961
|
-
}
|
|
6962
|
-
const resolve = function(...arguments_) {
|
|
6963
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
6964
|
-
let resolvedPath = "";
|
|
6965
|
-
let resolvedAbsolute = false;
|
|
6966
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
6967
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
6968
|
-
if (!path || path.length === 0) {
|
|
6969
|
-
continue;
|
|
6970
|
-
}
|
|
6971
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
6972
|
-
resolvedAbsolute = isAbsolute(path);
|
|
6973
|
-
}
|
|
6974
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
6975
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
6976
|
-
return `/${resolvedPath}`;
|
|
6977
|
-
}
|
|
6978
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
6979
|
-
};
|
|
6980
|
-
function normalizeString(path, allowAboveRoot) {
|
|
6981
|
-
let res = "";
|
|
6982
|
-
let lastSegmentLength = 0;
|
|
6983
|
-
let lastSlash = -1;
|
|
6984
|
-
let dots = 0;
|
|
6985
|
-
let char = null;
|
|
6986
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
6987
|
-
if (index < path.length) {
|
|
6988
|
-
char = path[index];
|
|
6989
|
-
} else if (char === "/") {
|
|
6990
|
-
break;
|
|
6991
|
-
} else {
|
|
6992
|
-
char = "/";
|
|
6993
|
-
}
|
|
6994
|
-
if (char === "/") {
|
|
6995
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
6996
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
6997
|
-
if (res.length > 2) {
|
|
6998
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
6999
|
-
if (lastSlashIndex === -1) {
|
|
7000
|
-
res = "";
|
|
7001
|
-
lastSegmentLength = 0;
|
|
7002
|
-
} else {
|
|
7003
|
-
res = res.slice(0, lastSlashIndex);
|
|
7004
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
7005
|
-
}
|
|
7006
|
-
lastSlash = index;
|
|
7007
|
-
dots = 0;
|
|
7008
|
-
continue;
|
|
7009
|
-
} else if (res.length > 0) {
|
|
7010
|
-
res = "";
|
|
7011
|
-
lastSegmentLength = 0;
|
|
7012
|
-
lastSlash = index;
|
|
7013
|
-
dots = 0;
|
|
7014
|
-
continue;
|
|
7015
|
-
}
|
|
7016
|
-
}
|
|
7017
|
-
if (allowAboveRoot) {
|
|
7018
|
-
res += res.length > 0 ? "/.." : "..";
|
|
7019
|
-
lastSegmentLength = 2;
|
|
7020
|
-
}
|
|
7021
|
-
} else {
|
|
7022
|
-
if (res.length > 0) {
|
|
7023
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
7024
|
-
} else {
|
|
7025
|
-
res = path.slice(lastSlash + 1, index);
|
|
7026
|
-
}
|
|
7027
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
7028
|
-
}
|
|
7029
|
-
lastSlash = index;
|
|
7030
|
-
dots = 0;
|
|
7031
|
-
} else if (char === "." && dots !== -1) {
|
|
7032
|
-
++dots;
|
|
7033
|
-
} else {
|
|
7034
|
-
dots = -1;
|
|
7035
|
-
}
|
|
7036
|
-
}
|
|
7037
|
-
return res;
|
|
7038
|
-
}
|
|
7039
|
-
const isAbsolute = function(p) {
|
|
7040
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
7041
|
-
};
|
|
7042
|
-
const relative = function(from, to) {
|
|
7043
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7044
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7045
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
7046
|
-
return _to.join("/");
|
|
7047
|
-
}
|
|
7048
|
-
const _fromCopy = [..._from];
|
|
7049
|
-
for (const segment of _fromCopy) {
|
|
7050
|
-
if (_to[0] !== segment) {
|
|
7051
|
-
break;
|
|
7052
|
-
}
|
|
7053
|
-
_from.shift();
|
|
7054
|
-
_to.shift();
|
|
7055
|
-
}
|
|
7056
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
7057
|
-
};
|
|
7058
|
-
|
|
7059
6840
|
const decoder = new TextDecoder();
|
|
7060
6841
|
const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
|
7061
6842
|
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
|
|
@@ -7840,6 +7621,225 @@ function imageMeta(input) {
|
|
|
7840
7621
|
throw new TypeError(`Unsupported file type: ${type}`);
|
|
7841
7622
|
}
|
|
7842
7623
|
|
|
7624
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
7625
|
+
function normalizeWindowsPath(input = "") {
|
|
7626
|
+
if (!input) {
|
|
7627
|
+
return input;
|
|
7628
|
+
}
|
|
7629
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
7630
|
+
}
|
|
7631
|
+
|
|
7632
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
7633
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
7634
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
7635
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
7636
|
+
const normalize = function(path) {
|
|
7637
|
+
if (path.length === 0) {
|
|
7638
|
+
return ".";
|
|
7639
|
+
}
|
|
7640
|
+
path = normalizeWindowsPath(path);
|
|
7641
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
7642
|
+
const isPathAbsolute = isAbsolute(path);
|
|
7643
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
7644
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
7645
|
+
if (path.length === 0) {
|
|
7646
|
+
if (isPathAbsolute) {
|
|
7647
|
+
return "/";
|
|
7648
|
+
}
|
|
7649
|
+
return trailingSeparator ? "./" : ".";
|
|
7650
|
+
}
|
|
7651
|
+
if (trailingSeparator) {
|
|
7652
|
+
path += "/";
|
|
7653
|
+
}
|
|
7654
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
7655
|
+
path += "/";
|
|
7656
|
+
}
|
|
7657
|
+
if (isUNCPath) {
|
|
7658
|
+
if (!isPathAbsolute) {
|
|
7659
|
+
return `//./${path}`;
|
|
7660
|
+
}
|
|
7661
|
+
return `//${path}`;
|
|
7662
|
+
}
|
|
7663
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
7664
|
+
};
|
|
7665
|
+
const join = function(...arguments_) {
|
|
7666
|
+
if (arguments_.length === 0) {
|
|
7667
|
+
return ".";
|
|
7668
|
+
}
|
|
7669
|
+
let joined;
|
|
7670
|
+
for (const argument of arguments_) {
|
|
7671
|
+
if (argument && argument.length > 0) {
|
|
7672
|
+
if (joined === void 0) {
|
|
7673
|
+
joined = argument;
|
|
7674
|
+
} else {
|
|
7675
|
+
joined += `/${argument}`;
|
|
7676
|
+
}
|
|
7677
|
+
}
|
|
7678
|
+
}
|
|
7679
|
+
if (joined === void 0) {
|
|
7680
|
+
return ".";
|
|
7681
|
+
}
|
|
7682
|
+
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
7683
|
+
};
|
|
7684
|
+
function cwd() {
|
|
7685
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
7686
|
+
return process.cwd().replace(/\\/g, "/");
|
|
7687
|
+
}
|
|
7688
|
+
return "/";
|
|
7689
|
+
}
|
|
7690
|
+
const resolve = function(...arguments_) {
|
|
7691
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
7692
|
+
let resolvedPath = "";
|
|
7693
|
+
let resolvedAbsolute = false;
|
|
7694
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
7695
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
7696
|
+
if (!path || path.length === 0) {
|
|
7697
|
+
continue;
|
|
7698
|
+
}
|
|
7699
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
7700
|
+
resolvedAbsolute = isAbsolute(path);
|
|
7701
|
+
}
|
|
7702
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
7703
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
7704
|
+
return `/${resolvedPath}`;
|
|
7705
|
+
}
|
|
7706
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
7707
|
+
};
|
|
7708
|
+
function normalizeString(path, allowAboveRoot) {
|
|
7709
|
+
let res = "";
|
|
7710
|
+
let lastSegmentLength = 0;
|
|
7711
|
+
let lastSlash = -1;
|
|
7712
|
+
let dots = 0;
|
|
7713
|
+
let char = null;
|
|
7714
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
7715
|
+
if (index < path.length) {
|
|
7716
|
+
char = path[index];
|
|
7717
|
+
} else if (char === "/") {
|
|
7718
|
+
break;
|
|
7719
|
+
} else {
|
|
7720
|
+
char = "/";
|
|
7721
|
+
}
|
|
7722
|
+
if (char === "/") {
|
|
7723
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
7724
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
7725
|
+
if (res.length > 2) {
|
|
7726
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
7727
|
+
if (lastSlashIndex === -1) {
|
|
7728
|
+
res = "";
|
|
7729
|
+
lastSegmentLength = 0;
|
|
7730
|
+
} else {
|
|
7731
|
+
res = res.slice(0, lastSlashIndex);
|
|
7732
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
7733
|
+
}
|
|
7734
|
+
lastSlash = index;
|
|
7735
|
+
dots = 0;
|
|
7736
|
+
continue;
|
|
7737
|
+
} else if (res.length > 0) {
|
|
7738
|
+
res = "";
|
|
7739
|
+
lastSegmentLength = 0;
|
|
7740
|
+
lastSlash = index;
|
|
7741
|
+
dots = 0;
|
|
7742
|
+
continue;
|
|
7743
|
+
}
|
|
7744
|
+
}
|
|
7745
|
+
if (allowAboveRoot) {
|
|
7746
|
+
res += res.length > 0 ? "/.." : "..";
|
|
7747
|
+
lastSegmentLength = 2;
|
|
7748
|
+
}
|
|
7749
|
+
} else {
|
|
7750
|
+
if (res.length > 0) {
|
|
7751
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
7752
|
+
} else {
|
|
7753
|
+
res = path.slice(lastSlash + 1, index);
|
|
7754
|
+
}
|
|
7755
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
7756
|
+
}
|
|
7757
|
+
lastSlash = index;
|
|
7758
|
+
dots = 0;
|
|
7759
|
+
} else if (char === "." && dots !== -1) {
|
|
7760
|
+
++dots;
|
|
7761
|
+
} else {
|
|
7762
|
+
dots = -1;
|
|
7763
|
+
}
|
|
7764
|
+
}
|
|
7765
|
+
return res;
|
|
7766
|
+
}
|
|
7767
|
+
const isAbsolute = function(p) {
|
|
7768
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
7769
|
+
};
|
|
7770
|
+
const relative = function(from, to) {
|
|
7771
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7772
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7773
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
7774
|
+
return _to.join("/");
|
|
7775
|
+
}
|
|
7776
|
+
const _fromCopy = [..._from];
|
|
7777
|
+
for (const segment of _fromCopy) {
|
|
7778
|
+
if (_to[0] !== segment) {
|
|
7779
|
+
break;
|
|
7780
|
+
}
|
|
7781
|
+
_from.shift();
|
|
7782
|
+
_to.shift();
|
|
7783
|
+
}
|
|
7784
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
7785
|
+
};
|
|
7786
|
+
|
|
7787
|
+
const DEBOUNCE_DEFAULTS = {
|
|
7788
|
+
trailing: true
|
|
7789
|
+
};
|
|
7790
|
+
function debounce(fn, wait = 25, options = {}) {
|
|
7791
|
+
options = { ...DEBOUNCE_DEFAULTS, ...options };
|
|
7792
|
+
if (!Number.isFinite(wait)) {
|
|
7793
|
+
throw new TypeError("Expected `wait` to be a finite number");
|
|
7794
|
+
}
|
|
7795
|
+
let leadingValue;
|
|
7796
|
+
let timeout;
|
|
7797
|
+
let resolveList = [];
|
|
7798
|
+
let currentPromise;
|
|
7799
|
+
let trailingArgs;
|
|
7800
|
+
const applyFn = (_this, args) => {
|
|
7801
|
+
currentPromise = _applyPromised(fn, _this, args);
|
|
7802
|
+
currentPromise.finally(() => {
|
|
7803
|
+
currentPromise = null;
|
|
7804
|
+
if (options.trailing && trailingArgs && !timeout) {
|
|
7805
|
+
const promise = applyFn(_this, trailingArgs);
|
|
7806
|
+
trailingArgs = null;
|
|
7807
|
+
return promise;
|
|
7808
|
+
}
|
|
7809
|
+
});
|
|
7810
|
+
return currentPromise;
|
|
7811
|
+
};
|
|
7812
|
+
return function(...args) {
|
|
7813
|
+
if (currentPromise) {
|
|
7814
|
+
if (options.trailing) {
|
|
7815
|
+
trailingArgs = args;
|
|
7816
|
+
}
|
|
7817
|
+
return currentPromise;
|
|
7818
|
+
}
|
|
7819
|
+
return new Promise((resolve) => {
|
|
7820
|
+
const shouldCallNow = !timeout && options.leading;
|
|
7821
|
+
clearTimeout(timeout);
|
|
7822
|
+
timeout = setTimeout(() => {
|
|
7823
|
+
timeout = null;
|
|
7824
|
+
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
7825
|
+
for (const _resolve of resolveList) {
|
|
7826
|
+
_resolve(promise);
|
|
7827
|
+
}
|
|
7828
|
+
resolveList = [];
|
|
7829
|
+
}, wait);
|
|
7830
|
+
if (shouldCallNow) {
|
|
7831
|
+
leadingValue = applyFn(this, args);
|
|
7832
|
+
resolve(leadingValue);
|
|
7833
|
+
} else {
|
|
7834
|
+
resolveList.push(resolve);
|
|
7835
|
+
}
|
|
7836
|
+
});
|
|
7837
|
+
};
|
|
7838
|
+
}
|
|
7839
|
+
async function _applyPromised(fn, _this, args) {
|
|
7840
|
+
return await fn.apply(_this, args);
|
|
7841
|
+
}
|
|
7842
|
+
|
|
7843
7843
|
function guessType(path) {
|
|
7844
7844
|
if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path))
|
|
7845
7845
|
return "image";
|