@mxfb/tools 0.1.1 → 0.2.3
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/agnostic/index.d.ts +1 -23
- package/agnostic/misc/elo/index.d.ts +31 -0
- package/agnostic/misc/elo/index.js +6 -0
- package/agnostic/misc/index.d.ts +4 -20
- package/agnostic/misc/index.js +6 -35
- package/agnostic/misc/tennis/index.d.ts +60 -0
- package/agnostic/misc/tennis/index.js +6 -0
- package/chunks/chunk-TTZHPIH7.js +237 -0
- package/chunks/chunk-ZC5RZBNY.js +33 -0
- package/components/index.d.ts +1 -4
- package/node/index.d.ts +2 -6
- package/package.json +15 -15
- package/shared/errors/index.d.ts +132 -8
- package/agnostic/arrays/index.d.ts +0 -11
- package/agnostic/arrays/is-array-of/index.d.ts +0 -5
- package/agnostic/arrays/is-array-of/index.js +0 -23
- package/agnostic/async/index.d.ts +0 -8
- package/agnostic/async/index.js +0 -20
- package/agnostic/async/timeout-call/index.d.ts +0 -1
- package/agnostic/async/timeout-call/index.js +0 -6
- package/agnostic/async/transitions/index.d.ts +0 -41
- package/agnostic/async/transitions/index.js +0 -7
- package/agnostic/async/wait/index.d.ts +0 -1
- package/agnostic/async/wait/index.js +0 -6
- package/agnostic/booleans/index.d.ts +0 -8
- package/agnostic/booleans/index.js +0 -17
- package/agnostic/booleans/is-falsy/index.d.ts +0 -7
- package/agnostic/booleans/is-falsy/index.js +0 -11
- package/agnostic/css/bem/BEM.d.ts +0 -29
- package/agnostic/css/bem/getNamesArr.d.ts +0 -2
- package/agnostic/css/bem/index.d.ts +0 -7
- package/agnostic/css/bem/index.js +0 -9
- package/agnostic/css/generate-nice-color/index.d.ts +0 -2
- package/agnostic/css/generate-nice-color/index.js +0 -8
- package/agnostic/css/index.d.ts +0 -14
- package/agnostic/css/index.js +0 -177
- package/agnostic/css/is-valid-css-class-name/index.d.ts +0 -2
- package/agnostic/css/is-valid-css-class-name/index.js +0 -8
- package/agnostic/css/styles-set/index.d.ts +0 -37
- package/agnostic/errors/index.d.ts +0 -30
- package/agnostic/errors/index.js +0 -6
- package/agnostic/html/get-node-ancestors/index.d.ts +0 -1
- package/agnostic/html/get-node-ancestors/index.js +0 -6
- package/agnostic/html/get-position-inside-parent/index.d.ts +0 -1
- package/agnostic/html/get-position-inside-parent/index.js +0 -6
- package/agnostic/html/index.d.ts +0 -17
- package/agnostic/html/index.js +0 -39
- package/agnostic/html/insert-node/index.d.ts +0 -2
- package/agnostic/html/insert-node/index.js +0 -6
- package/agnostic/html/placeholders/index.d.ts +0 -9
- package/agnostic/html/placeholders/index.js +0 -6
- package/agnostic/html/sanitize/index.d.ts +0 -24
- package/agnostic/html/sanitize/index.js +0 -9
- package/agnostic/html/selector-to-element/index.d.ts +0 -1
- package/agnostic/html/selector-to-element/index.js +0 -9
- package/agnostic/html/string-to-nodes/index.d.ts +0 -7
- package/agnostic/html/string-to-nodes/index.js +0 -10
- package/agnostic/misc/assert/index.d.ts +0 -5
- package/agnostic/misc/assert/index.js +0 -6
- package/agnostic/misc/cast/index.d.ts +0 -9
- package/agnostic/misc/cast/index.js +0 -8
- package/agnostic/misc/crossenv/index.d.ts +0 -13
- package/agnostic/misc/crossenv/index.js +0 -6
- package/agnostic/misc/get-current-downlink/index.d.ts +0 -1
- package/agnostic/misc/get-current-downlink/index.js +0 -6
- package/agnostic/misc/is-constructor-function/index.d.ts +0 -2
- package/agnostic/misc/is-constructor-function/index.js +0 -6
- package/agnostic/misc/is-nullish/index.d.ts +0 -4
- package/agnostic/misc/is-nullish/index.js +0 -10
- package/agnostic/misc/logs/index.d.ts +0 -55
- package/agnostic/misc/logs/index.js +0 -6
- package/agnostic/misc/random/index.d.ts +0 -10
- package/agnostic/misc/random/index.js +0 -6
- package/agnostic/numbers/absolute-modulo/index.d.ts +0 -1
- package/agnostic/numbers/absolute-modulo/index.js +0 -6
- package/agnostic/numbers/clamp/index.d.ts +0 -1
- package/agnostic/numbers/clamp/index.js +0 -6
- package/agnostic/numbers/index.d.ts +0 -13
- package/agnostic/numbers/index.js +0 -30
- package/agnostic/numbers/interpolate/index.d.ts +0 -1
- package/agnostic/numbers/interpolate/index.js +0 -6
- package/agnostic/numbers/responsive-harmonics/index.d.ts +0 -10
- package/agnostic/numbers/responsive-harmonics/index.js +0 -9
- package/agnostic/numbers/round/index.d.ts +0 -1
- package/agnostic/numbers/round/index.js +0 -6
- package/agnostic/objects/enums/index.d.ts +0 -4
- package/agnostic/objects/enums/index.js +0 -7
- package/agnostic/objects/enums/is-in-enum/index.d.ts +0 -1
- package/agnostic/objects/enums/is-in-enum/index.js +0 -6
- package/agnostic/objects/flatten-getters/index.d.ts +0 -1
- package/agnostic/objects/flatten-getters/index.js +0 -9
- package/agnostic/objects/index.d.ts +0 -12
- package/agnostic/objects/index.js +0 -32
- package/agnostic/objects/is-object/index.d.ts +0 -1
- package/agnostic/objects/is-object/index.js +0 -6
- package/agnostic/objects/is-record/index.d.ts +0 -1
- package/agnostic/objects/is-record/index.js +0 -6
- package/agnostic/objects/record-format/index.d.ts +0 -11
- package/agnostic/objects/record-format/index.js +0 -16
- package/agnostic/objects/validation/index.d.ts +0 -3
- package/agnostic/objects/validation/index.js +0 -6
- package/agnostic/optim/index.d.ts +0 -7
- package/agnostic/optim/index.js +0 -18
- package/agnostic/optim/memoize/index.d.ts +0 -3
- package/agnostic/optim/memoize/index.js +0 -6
- package/agnostic/optim/throttle-debounce/index.d.ts +0 -30
- package/agnostic/optim/throttle-debounce/index.js +0 -8
- package/agnostic/optim/throttle-debounce/types.d.ts +0 -2
- package/agnostic/regexps/index.d.ts +0 -23
- package/agnostic/regexps/index.js +0 -89
- package/agnostic/strings/char-codes/index.d.ts +0 -17
- package/agnostic/strings/char-codes/index.js +0 -6
- package/agnostic/strings/index.d.ts +0 -14
- package/agnostic/strings/index.js +0 -32
- package/agnostic/strings/matches/index.d.ts +0 -3
- package/agnostic/strings/matches/index.js +0 -10
- package/agnostic/strings/normalize-indent/index.d.ts +0 -1
- package/agnostic/strings/normalize-indent/index.js +0 -6
- package/agnostic/strings/replace-all/index.d.ts +0 -1
- package/agnostic/strings/replace-all/index.js +0 -6
- package/agnostic/strings/to-alphanum/index.d.ts +0 -1
- package/agnostic/strings/to-alphanum/index.js +0 -6
- package/chunks/chunk-32IRF4OP.js +0 -9
- package/chunks/chunk-34U4HX4V.js +0 -73
- package/chunks/chunk-4GDNHUCZ.js +0 -162
- package/chunks/chunk-4QQBKBYH.js +0 -59
- package/chunks/chunk-4VC5PT5T.js +0 -13
- package/chunks/chunk-5LNUCDQ6.js +0 -132
- package/chunks/chunk-7AWTHZLY.js +0 -12
- package/chunks/chunk-7DBNMU6N.js +0 -14
- package/chunks/chunk-7YW5HL6N.js +0 -168
- package/chunks/chunk-COVPTTAD.js +0 -10
- package/chunks/chunk-DNIOWD7K.js +0 -8
- package/chunks/chunk-DQNJQBC6.js +0 -10
- package/chunks/chunk-E6MSDKON.js +0 -13
- package/chunks/chunk-EDVNAV3G.js +0 -72
- package/chunks/chunk-EW46EXFB.js +0 -8
- package/chunks/chunk-FPEW3A27.js +0 -14
- package/chunks/chunk-GJOU3UAL.js +0 -36
- package/chunks/chunk-HC6ZOHCS.js +0 -14
- package/chunks/chunk-HGCG2J77.js +0 -122
- package/chunks/chunk-IFD7GSGK.js +0 -130
- package/chunks/chunk-JQXNEJAP.js +0 -18
- package/chunks/chunk-JWBDZPQG.js +0 -18
- package/chunks/chunk-K37RALUX.js +0 -8
- package/chunks/chunk-KQT5CTGF.js +0 -21
- package/chunks/chunk-LEXQ6E6L.js +0 -31
- package/chunks/chunk-LQFKUNVQ.js +0 -19
- package/chunks/chunk-MF56TTC5.js +0 -15
- package/chunks/chunk-MT74WIQR.js +0 -41
- package/chunks/chunk-NRITRUZW.js +0 -10
- package/chunks/chunk-NRJQKVQV.js +0 -31
- package/chunks/chunk-OSAXBA7G.js +0 -10
- package/chunks/chunk-PO3V3I57.js +0 -23
- package/chunks/chunk-QXAJXTXV.js +0 -19
- package/chunks/chunk-RCO57B6F.js +0 -9
- package/chunks/chunk-SQZGZ3VT.js +0 -15
- package/chunks/chunk-UYTXXUU7.js +0 -54
- package/chunks/chunk-VTPRO4NJ.js +0 -10
- package/chunks/chunk-VYW4IADX.js +0 -35
- package/chunks/chunk-VZDUZTW6.js +0 -113
- package/chunks/chunk-W5A2TON3.js +0 -10
- package/chunks/chunk-W7YBGJ4H.js +0 -28
- package/chunks/chunk-WLL3FNVL.js +0 -40
- package/chunks/chunk-WOAYU6LB.js +0 -13
- package/chunks/chunk-XA4HVHJ4.js +0 -18
- package/chunks/chunk-XN3PZIVL.js +0 -38
- package/chunks/chunk-YDIBNEGA.js +0 -9
- package/components/Comp/index.d.ts +0 -1
- package/index.d.ts +0 -3
- package/node/files/index.d.ts +0 -9
- package/node/files/index.js +0 -21
- package/node/files/is-in-directory/index.d.ts +0 -1
- package/node/files/is-in-directory/index.js +0 -6
- package/node/files/read-write/index.d.ts +0 -9
- package/node/files/read-write/index.js +0 -6
- package/node/files/subpaths/index.d.ts +0 -34
- package/node/files/subpaths/index.js +0 -7
- package/node/image/index.d.ts +0 -9
- package/node/image/index.js +0 -74
- package/node/process/index.d.ts +0 -8
- package/node/process/index.js +0 -20
- package/node/process/on-exit/index.d.ts +0 -5
- package/node/process/on-exit/index.js +0 -14
package/chunks/chunk-4VC5PT5T.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/agnostic/async/timeout-call/index.ts
|
|
2
|
-
function timeoutCall(callback, timeoutMs) {
|
|
3
|
-
return new Promise(async (resolve, reject) => {
|
|
4
|
-
const rejectTimeout = setTimeout(() => reject(false), timeoutMs);
|
|
5
|
-
const callbackResult = await callback();
|
|
6
|
-
clearTimeout(rejectTimeout);
|
|
7
|
-
return resolve(callbackResult);
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
timeoutCall
|
|
13
|
-
};
|
package/chunks/chunk-5LNUCDQ6.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// src/agnostic/misc/logs/index.ts
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
var Logs;
|
|
4
|
-
((Logs2) => {
|
|
5
|
-
function makeTextBlock(text, vPadding = 1, hPadding = vPadding) {
|
|
6
|
-
const lines = text.split("\n");
|
|
7
|
-
const longestLine = Math.max(...lines.map((line) => line.length));
|
|
8
|
-
const textBlockArr = new Array(lines.length + 2 * vPadding).fill(null).map(() => new Array(longestLine + hPadding * 2).fill(" "));
|
|
9
|
-
lines.forEach((line, linePos) => {
|
|
10
|
-
const chars = line.split("");
|
|
11
|
-
textBlockArr[linePos + vPadding]?.splice(hPadding, chars.length, ...chars);
|
|
12
|
-
});
|
|
13
|
-
return textBlockArr.map((lineArr) => lineArr.join("")).join("\n");
|
|
14
|
-
}
|
|
15
|
-
Logs2.makeTextBlock = makeTextBlock;
|
|
16
|
-
Logs2.styles = {
|
|
17
|
-
regular: (text) => text,
|
|
18
|
-
light: (text) => chalk.grey(text),
|
|
19
|
-
danger: (text) => chalk.bold.bgRed.whiteBright(makeTextBlock(`/!\\
|
|
20
|
-
|
|
21
|
-
${text}
|
|
22
|
-
`, 2, 6)),
|
|
23
|
-
important: (text) => chalk.bold(text),
|
|
24
|
-
title: (text) => `# ${chalk.bold.underline(`${text}
|
|
25
|
-
`)}`,
|
|
26
|
-
info: (text) => chalk.blueBright(text),
|
|
27
|
-
error: (text) => chalk.red(text),
|
|
28
|
-
warning: (text) => chalk.yellow(text)
|
|
29
|
-
};
|
|
30
|
-
const logsTimeOrigin = /* @__PURE__ */ new Date();
|
|
31
|
-
class Log {
|
|
32
|
-
type;
|
|
33
|
-
data;
|
|
34
|
-
time;
|
|
35
|
-
stack;
|
|
36
|
-
constructor(type, data) {
|
|
37
|
-
this.type = type;
|
|
38
|
-
this.data = data;
|
|
39
|
-
this.time = /* @__PURE__ */ new Date();
|
|
40
|
-
this.stack = new Error().stack ?? "";
|
|
41
|
-
}
|
|
42
|
-
get displayTime() {
|
|
43
|
-
return this.time.toLocaleDateString("en-US", {
|
|
44
|
-
year: "numeric",
|
|
45
|
-
month: "short",
|
|
46
|
-
day: "numeric",
|
|
47
|
-
weekday: "short",
|
|
48
|
-
hour: "numeric",
|
|
49
|
-
minute: "numeric",
|
|
50
|
-
second: "numeric"
|
|
51
|
-
}) + `:${this.time.getMilliseconds()}`;
|
|
52
|
-
}
|
|
53
|
-
get elapsedTimeMs() {
|
|
54
|
-
return (this.time.getTime() - logsTimeOrigin.getTime()) / 1e3;
|
|
55
|
-
}
|
|
56
|
-
get displayStack() {
|
|
57
|
-
return this.stack.split("\n").map((line) => line.trim()).slice(4).join("\n");
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
class Logger {
|
|
61
|
-
_private_threads = /* @__PURE__ */ new Map();
|
|
62
|
-
constructor() {
|
|
63
|
-
this.dir = this.dir.bind(this);
|
|
64
|
-
this.error = this.error.bind(this);
|
|
65
|
-
this.log = this.log.bind(this);
|
|
66
|
-
this.warn = this.warn.bind(this);
|
|
67
|
-
this.setLog = this.setLog.bind(this);
|
|
68
|
-
this.print = this.print.bind(this);
|
|
69
|
-
this.printThreads = this.printThreads.bind(this);
|
|
70
|
-
}
|
|
71
|
-
// assert (thread: string = '', ...args: ConsoleMethodsParams['assert']) { this.setLog(thread, 'assert', args) }
|
|
72
|
-
// count (thread: string = '', ...args: ConsoleMethodsParams['count']) { this.setLog(thread, 'count', args) }
|
|
73
|
-
// countReset (thread: string = '', ...args: ConsoleMethodsParams['countReset']) { this.setLog(thread, 'countReset', args) }
|
|
74
|
-
// debug (thread: string = '', ...args: ConsoleMethodsParams['debug']) { this.setLog(thread, 'debug', args) }
|
|
75
|
-
dir(thread = "", ...args) {
|
|
76
|
-
this.setLog(thread, "dir", args);
|
|
77
|
-
}
|
|
78
|
-
// dirxml (thread: string = '', ...args: ConsoleMethodsParams['dirxml']) { this.setLog(thread, 'dirxml', args) }
|
|
79
|
-
error(thread = "", ...args) {
|
|
80
|
-
this.setLog(thread, "error", args);
|
|
81
|
-
}
|
|
82
|
-
// group (thread: string = '', ...args: ConsoleMethodsParams['group']) { this.setLog(thread, 'group', args) }
|
|
83
|
-
// groupCollapsed (thread: string = '', ...args: ConsoleMethodsParams['groupCollapsed']) { this.setLog(thread, 'groupCollapsed', args) }
|
|
84
|
-
// groupEnd (thread: string = '', ...args: ConsoleMethodsParams['groupEnd']) { this.setLog(thread, 'groupEnd', args) }
|
|
85
|
-
// info (thread: string = '', ...args: ConsoleMethodsParams['info']) { this.setLog(thread, 'info', args) }
|
|
86
|
-
log(thread = "", ...args) {
|
|
87
|
-
this.setLog(thread, "log", args);
|
|
88
|
-
}
|
|
89
|
-
// table (thread: string = '', ...args: ConsoleMethodsParams['table']) { this.setLog(thread, 'table', args) }
|
|
90
|
-
// time (thread: string = '', ...args: ConsoleMethodsParams['time']) { this.setLog(thread, 'time', args) }
|
|
91
|
-
// timeEnd (thread: string = '', ...args: ConsoleMethodsParams['timeEnd']) { this.setLog(thread, 'timeEnd', args) }
|
|
92
|
-
// trace (thread: string = '', ...args: ConsoleMethodsParams['trace']) { this.setLog(thread, 'trace', args) }
|
|
93
|
-
warn(thread = "", ...args) {
|
|
94
|
-
this.setLog(thread, "warn", args);
|
|
95
|
-
}
|
|
96
|
-
setLog(threadName, type, data) {
|
|
97
|
-
const log = new Log(type, data);
|
|
98
|
-
const thread = this._private_threads.get(threadName) ?? [];
|
|
99
|
-
this._private_threads.set(threadName, [...thread, log]);
|
|
100
|
-
return this;
|
|
101
|
-
}
|
|
102
|
-
print(threadFilter, withStack) {
|
|
103
|
-
const allLogs = Array.from(this._private_threads.entries()).map(([threadName, logs]) => logs.map((log) => ({ threadName, log }))).flat().sort((eltA, eltB) => eltA.log.time.getTime() - eltB.log.time.getTime()).filter(({ threadName }) => {
|
|
104
|
-
if (threadFilter === void 0) return true;
|
|
105
|
-
return threadName === threadFilter;
|
|
106
|
-
});
|
|
107
|
-
allLogs.forEach(({ threadName, log }) => {
|
|
108
|
-
console.log(`%c${threadName}`, "font-weight: 800; color: white; background: black; padding: 4px;", `+${log.elapsedTimeMs}s \u2013`, log.displayTime);
|
|
109
|
-
if (withStack === true) console.log(`%c${log.displayStack}`, "color: grey; font-size: inherit;");
|
|
110
|
-
console[log.type](...log.data);
|
|
111
|
-
console.log("");
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
printThreads(withStack) {
|
|
115
|
-
Array.from(this._private_threads.entries()).forEach(([threadName, logs]) => {
|
|
116
|
-
console.group(`%c${threadName}`, "font-weight: 800; color: white; background: black; padding: 4px;");
|
|
117
|
-
logs.forEach((log) => {
|
|
118
|
-
console.log(`+${log.elapsedTimeMs}s \u2013`, log.displayTime);
|
|
119
|
-
if (withStack === true) console.log(`%c${log.displayStack}`, "color: grey; font-size: inherit;");
|
|
120
|
-
console[log.type](...log.data);
|
|
121
|
-
console.log("");
|
|
122
|
-
});
|
|
123
|
-
console.groupEnd();
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
Logs2.Logger = Logger;
|
|
128
|
-
})(Logs || (Logs = {}));
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
Logs
|
|
132
|
-
};
|
package/chunks/chunk-7AWTHZLY.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// src/agnostic/misc/get-current-downlink/index.ts
|
|
2
|
-
function getCurrentDownlink() {
|
|
3
|
-
if (typeof window !== "object") return void 0;
|
|
4
|
-
if (typeof window.navigator !== "object") return void 0;
|
|
5
|
-
const navigator = window.navigator;
|
|
6
|
-
const connection = navigator?.connection ?? navigator?.mozConnection ?? navigator?.webkitConnection;
|
|
7
|
-
return connection?.downlink;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
getCurrentDownlink
|
|
12
|
-
};
|
package/chunks/chunk-7DBNMU6N.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/node/files/read-write/index.ts
|
|
2
|
-
import { promises as fs } from "node:fs";
|
|
3
|
-
async function readWrite(path, editor, ...options) {
|
|
4
|
-
const [readOptions, writeOptions] = options;
|
|
5
|
-
const read = await fs.readFile(path, readOptions);
|
|
6
|
-
const edited = editor(read);
|
|
7
|
-
const actualWriteOptions = options.length === 2 ? writeOptions : readOptions;
|
|
8
|
-
await fs.writeFile(path, edited, actualWriteOptions);
|
|
9
|
-
return edited;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
readWrite
|
|
14
|
-
};
|
package/chunks/chunk-7YW5HL6N.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isFalsy
|
|
3
|
-
} from "./chunk-QXAJXTXV.js";
|
|
4
|
-
import {
|
|
5
|
-
isValidClassName
|
|
6
|
-
} from "./chunk-W5A2TON3.js";
|
|
7
|
-
|
|
8
|
-
// src/agnostic/css/bem/getNamesArr.ts
|
|
9
|
-
function getNamesArr(arg) {
|
|
10
|
-
const returned = [];
|
|
11
|
-
if (typeof arg === "string") {
|
|
12
|
-
arg.trim().split(/\s+/gm).forEach((name) => {
|
|
13
|
-
if (isValidClassName(name)) returned.push(name);
|
|
14
|
-
});
|
|
15
|
-
} else if (Array.isArray(arg)) {
|
|
16
|
-
arg.forEach((elt) => returned.push(...getNamesArr(elt)));
|
|
17
|
-
} else if (typeof arg === "object" && arg !== null) {
|
|
18
|
-
Object.entries(arg).forEach(([key, val]) => {
|
|
19
|
-
if (!isFalsy(val)) returned.push(...getNamesArr(key));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return returned;
|
|
23
|
-
}
|
|
24
|
-
var getNamesArr_default = getNamesArr;
|
|
25
|
-
|
|
26
|
-
// src/agnostic/css/bem/BEM.ts
|
|
27
|
-
var BEM = class _BEM {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.findBlockByName = this.findBlockByName.bind(this);
|
|
30
|
-
this.addBlock = this.addBlock.bind(this);
|
|
31
|
-
this.addElement = this.addElement.bind(this);
|
|
32
|
-
this.addModifier = this.addModifier.bind(this);
|
|
33
|
-
this.copy = this.copy.bind(this);
|
|
34
|
-
this.block = this.block.bind(this);
|
|
35
|
-
this.element = this.element.bind(this);
|
|
36
|
-
this.modifier = this.modifier.bind(this);
|
|
37
|
-
this.blk = this.blk.bind(this);
|
|
38
|
-
this.elt = this.elt.bind(this);
|
|
39
|
-
this.mod = this.mod.bind(this);
|
|
40
|
-
this.cp = this.cp.bind(this);
|
|
41
|
-
this.addSingleBlock = this.addSingleBlock.bind(this);
|
|
42
|
-
this.addSingleElement = this.addSingleElement.bind(this);
|
|
43
|
-
this.addSingleModifier = this.addSingleModifier.bind(this);
|
|
44
|
-
this.setCurrentBlockByName = this.setCurrentBlockByName.bind(this);
|
|
45
|
-
this.createBlockByName = this.createBlockByName.bind(this);
|
|
46
|
-
this.getCurrentBlock = this.getCurrentBlock.bind(this);
|
|
47
|
-
}
|
|
48
|
-
addBlock(blockNameArg) {
|
|
49
|
-
const blocksNames = getNamesArr_default(blockNameArg);
|
|
50
|
-
blocksNames.forEach(this.addSingleBlock);
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
addElement(elementNameArg) {
|
|
54
|
-
const elementsNames = getNamesArr_default(elementNameArg);
|
|
55
|
-
elementsNames.forEach(this.addSingleElement);
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
addModifier(modifierNameArg) {
|
|
59
|
-
const currentBlock = this.getCurrentBlock();
|
|
60
|
-
if (currentBlock === void 0) return this;
|
|
61
|
-
const modifiersNames = getNamesArr_default(modifierNameArg);
|
|
62
|
-
modifiersNames.forEach(this.addSingleModifier);
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
copy() {
|
|
66
|
-
const copy = new _BEM();
|
|
67
|
-
this.blocks.forEach((block) => {
|
|
68
|
-
copy.addBlock(block.name);
|
|
69
|
-
block.modifiers.forEach(copy.addModifier);
|
|
70
|
-
});
|
|
71
|
-
return copy;
|
|
72
|
-
}
|
|
73
|
-
block(blockNameArg) {
|
|
74
|
-
return this.copy().addBlock(blockNameArg);
|
|
75
|
-
}
|
|
76
|
-
element(elementNameArg) {
|
|
77
|
-
return this.copy().addElement(elementNameArg);
|
|
78
|
-
}
|
|
79
|
-
modifier(modifierNameArg) {
|
|
80
|
-
return this.copy().addModifier(modifierNameArg);
|
|
81
|
-
}
|
|
82
|
-
blk(blockNameArg) {
|
|
83
|
-
return this.block(blockNameArg);
|
|
84
|
-
}
|
|
85
|
-
elt(elementNameArg) {
|
|
86
|
-
return this.element(elementNameArg);
|
|
87
|
-
}
|
|
88
|
-
mod(modifierNameArg) {
|
|
89
|
-
return this.modifier(modifierNameArg);
|
|
90
|
-
}
|
|
91
|
-
cp() {
|
|
92
|
-
return this.copy();
|
|
93
|
-
}
|
|
94
|
-
get value() {
|
|
95
|
-
return this.blocks.map((block) => {
|
|
96
|
-
return [block.name, ...block.modifiers.map((modifier) => {
|
|
97
|
-
return `${block.name}_${modifier}`;
|
|
98
|
-
})].join(" ");
|
|
99
|
-
}).join(" ");
|
|
100
|
-
}
|
|
101
|
-
get val() {
|
|
102
|
-
return this.value;
|
|
103
|
-
}
|
|
104
|
-
blocks = [];
|
|
105
|
-
findBlockByName(name) {
|
|
106
|
-
return this.blocks.find((block) => block.name === name);
|
|
107
|
-
}
|
|
108
|
-
addSingleBlock(blockName) {
|
|
109
|
-
if (this.findBlockByName(blockName) !== void 0) {
|
|
110
|
-
this.setCurrentBlockByName(blockName);
|
|
111
|
-
} else {
|
|
112
|
-
const block = this.createBlockByName(blockName);
|
|
113
|
-
this.blocks.push(block);
|
|
114
|
-
}
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
addSingleElement(elementName) {
|
|
118
|
-
const currentBlock = this.getCurrentBlock();
|
|
119
|
-
if (currentBlock === void 0) this.addBlock(elementName);
|
|
120
|
-
else {
|
|
121
|
-
currentBlock.name = currentBlock.name + "__" + elementName;
|
|
122
|
-
}
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
addSingleModifier(modifierName) {
|
|
126
|
-
const currentBlock = this.getCurrentBlock();
|
|
127
|
-
if (currentBlock !== void 0) {
|
|
128
|
-
currentBlock.modifiers.push(modifierName);
|
|
129
|
-
}
|
|
130
|
-
return this;
|
|
131
|
-
}
|
|
132
|
-
setCurrentBlockByName(blockName) {
|
|
133
|
-
const block = this.findBlockByName(blockName);
|
|
134
|
-
if (block !== void 0) {
|
|
135
|
-
const blockPos = this.blocks.indexOf(block);
|
|
136
|
-
this.blocks = [
|
|
137
|
-
...this.blocks.slice(0, blockPos),
|
|
138
|
-
...this.blocks.slice(blockPos + 1),
|
|
139
|
-
block
|
|
140
|
-
];
|
|
141
|
-
}
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
|
-
createBlockByName(blockName) {
|
|
145
|
-
return { name: blockName, modifiers: [] };
|
|
146
|
-
}
|
|
147
|
-
getCurrentBlock() {
|
|
148
|
-
return this.blocks.slice(-1)[0];
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
var BEM_default = BEM;
|
|
152
|
-
|
|
153
|
-
// src/agnostic/css/bem/index.ts
|
|
154
|
-
var Bem;
|
|
155
|
-
((Bem2) => {
|
|
156
|
-
Bem2.BEM = BEM_default;
|
|
157
|
-
function bem(blockNameArg) {
|
|
158
|
-
const bem2 = new BEM_default();
|
|
159
|
-
if (blockNameArg instanceof BEM_default) return blockNameArg.copy();
|
|
160
|
-
return bem2.addBlock(blockNameArg);
|
|
161
|
-
}
|
|
162
|
-
Bem2.bem = bem;
|
|
163
|
-
Bem2.getNamesArr = getNamesArr_default;
|
|
164
|
-
})(Bem || (Bem = {}));
|
|
165
|
-
|
|
166
|
-
export {
|
|
167
|
-
Bem
|
|
168
|
-
};
|
package/chunks/chunk-COVPTTAD.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/agnostic/strings/to-alphanum/index.ts
|
|
2
|
-
function toAlphanum(string, replacer = "") {
|
|
3
|
-
const replaced = string.replace(/[^a-z0-9]/igm, replacer);
|
|
4
|
-
if (replacer.length === 0) return replaced;
|
|
5
|
-
return replaced.replace(new RegExp(`${replacer}+`, "igm"), replacer);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
toAlphanum
|
|
10
|
-
};
|
package/chunks/chunk-DNIOWD7K.js
DELETED
package/chunks/chunk-DQNJQBC6.js
DELETED
package/chunks/chunk-E6MSDKON.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/agnostic/objects/enums/is-in-enum/index.ts
|
|
2
|
-
function isInEnum(enumObj, value) {
|
|
3
|
-
const keys = Object.keys(enumObj);
|
|
4
|
-
const values = Object.values(enumObj);
|
|
5
|
-
const numericValues = values.filter((val) => typeof val === "number");
|
|
6
|
-
const cleanKeys = keys.filter((key) => !numericValues.includes(parseInt(key, 10)));
|
|
7
|
-
const cleanValues = cleanKeys.map((cleanKey) => enumObj[cleanKey]);
|
|
8
|
-
return cleanValues.includes(value);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
isInEnum
|
|
13
|
-
};
|
package/chunks/chunk-EDVNAV3G.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// src/agnostic/css/generate-nice-color/index.ts
|
|
2
|
-
var niceColors = [
|
|
3
|
-
"fuchsia",
|
|
4
|
-
"teal",
|
|
5
|
-
"aliceblue",
|
|
6
|
-
"bisque",
|
|
7
|
-
"blueviolet",
|
|
8
|
-
"burlywood",
|
|
9
|
-
"chocolate",
|
|
10
|
-
"coral",
|
|
11
|
-
"cornflowerblue",
|
|
12
|
-
"crimson",
|
|
13
|
-
"darkblue",
|
|
14
|
-
"darkgoldenrod",
|
|
15
|
-
"darkkhaki",
|
|
16
|
-
"darkmagenta",
|
|
17
|
-
"darkolivegreen",
|
|
18
|
-
"darkorange",
|
|
19
|
-
"darkorchid",
|
|
20
|
-
"darkred",
|
|
21
|
-
"darksalmon",
|
|
22
|
-
"darkslateblue",
|
|
23
|
-
"darkslategray",
|
|
24
|
-
"darkviolet",
|
|
25
|
-
"deeppink",
|
|
26
|
-
"deepskyblue",
|
|
27
|
-
"dodgerblue",
|
|
28
|
-
"firebrick",
|
|
29
|
-
"floralwhite",
|
|
30
|
-
"gainsboro",
|
|
31
|
-
"gold",
|
|
32
|
-
"hotpink",
|
|
33
|
-
"indianred",
|
|
34
|
-
"indigo",
|
|
35
|
-
"khaki",
|
|
36
|
-
"lavender",
|
|
37
|
-
"lightcoral",
|
|
38
|
-
"lightgreen",
|
|
39
|
-
"lightsalmon",
|
|
40
|
-
"lightsteelblue",
|
|
41
|
-
"limegreen",
|
|
42
|
-
"magenta",
|
|
43
|
-
"mediumseagreen",
|
|
44
|
-
"mediumspringgreen",
|
|
45
|
-
"mediumvioletred",
|
|
46
|
-
"moccasin",
|
|
47
|
-
"orangered",
|
|
48
|
-
"orchid",
|
|
49
|
-
"palegoldenrod",
|
|
50
|
-
"palevioletred",
|
|
51
|
-
"peachpuff",
|
|
52
|
-
"peru",
|
|
53
|
-
"plum",
|
|
54
|
-
"royalblue",
|
|
55
|
-
"sandybrown",
|
|
56
|
-
"springgreen",
|
|
57
|
-
"tan",
|
|
58
|
-
"thistle",
|
|
59
|
-
"tomato",
|
|
60
|
-
"violet",
|
|
61
|
-
"wheat",
|
|
62
|
-
"yellowgreen"
|
|
63
|
-
];
|
|
64
|
-
var generateNiceColor = () => {
|
|
65
|
-
const pos = Math.floor(Math.random() * niceColors.length);
|
|
66
|
-
return niceColors[pos];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
niceColors,
|
|
71
|
-
generateNiceColor
|
|
72
|
-
};
|
package/chunks/chunk-EW46EXFB.js
DELETED
package/chunks/chunk-FPEW3A27.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/agnostic/objects/validation/index.ts
|
|
2
|
-
var Validation;
|
|
3
|
-
((Validation2) => {
|
|
4
|
-
function fromPartial(obj, partial) {
|
|
5
|
-
return Object.entries(partial).every(([key, val]) => {
|
|
6
|
-
return obj[key] === val;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
Validation2.fromPartial = fromPartial;
|
|
10
|
-
})(Validation || (Validation = {}));
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
Validation
|
|
14
|
-
};
|
package/chunks/chunk-GJOU3UAL.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/agnostic/misc/crossenv/index.ts
|
|
2
|
-
var Crossenv;
|
|
3
|
-
((Crossenv2) => {
|
|
4
|
-
let RuntimeName;
|
|
5
|
-
((RuntimeName2) => {
|
|
6
|
-
RuntimeName2["NODE"] = "Node.js";
|
|
7
|
-
RuntimeName2["BROWSER"] = "Browser";
|
|
8
|
-
RuntimeName2["DENO"] = "Deno";
|
|
9
|
-
RuntimeName2["REACT_NATIVE"] = "React Native";
|
|
10
|
-
RuntimeName2["ELECTRON"] = "Electron";
|
|
11
|
-
RuntimeName2["CLOUDFLARE"] = "Cloudflare Workers";
|
|
12
|
-
RuntimeName2["AWS_LAMBDA"] = "AWS Lambda";
|
|
13
|
-
})(RuntimeName = Crossenv2.RuntimeName || (Crossenv2.RuntimeName = {}));
|
|
14
|
-
function detectRuntime() {
|
|
15
|
-
if (typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined") return "Node.js" /* NODE */;
|
|
16
|
-
if (typeof window !== "undefined" && typeof window.document !== "undefined") return "Browser" /* BROWSER */;
|
|
17
|
-
if (typeof Deno !== "undefined") return "Deno" /* DENO */;
|
|
18
|
-
if (typeof process !== "undefined" && typeof navigator.userAgent === "string" && /ReactNative/.test(navigator.userAgent)) return "React Native" /* REACT_NATIVE */;
|
|
19
|
-
if (typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.version.electron !== "undefined") return "Electron" /* ELECTRON */;
|
|
20
|
-
if (typeof self !== "undefined" && typeof self.addEventListener === "function" && typeof Headers !== "undefined") return "Cloudflare Workers" /* CLOUDFLARE */;
|
|
21
|
-
if (typeof AWS !== "undefined" && typeof AWS.Lambda !== "undefined") return "AWS Lambda" /* AWS_LAMBDA */;
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
Crossenv2.detectRuntime = detectRuntime;
|
|
25
|
-
function getDocument() {
|
|
26
|
-
const runtime = detectRuntime();
|
|
27
|
-
const runtimesWithGlobalWindow = ["Browser" /* BROWSER */, "Electron" /* ELECTRON */];
|
|
28
|
-
const runtimeHasGlobalWindow = runtimesWithGlobalWindow.includes(runtime);
|
|
29
|
-
return runtimeHasGlobalWindow ? window.document : null;
|
|
30
|
-
}
|
|
31
|
-
Crossenv2.getDocument = getDocument;
|
|
32
|
-
})(Crossenv || (Crossenv = {}));
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
Crossenv
|
|
36
|
-
};
|
package/chunks/chunk-HC6ZOHCS.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/agnostic/misc/is-nullish/index.ts
|
|
2
|
-
var nullishValues = [null, void 0];
|
|
3
|
-
function isNullish(val) {
|
|
4
|
-
return nullishValues.includes(val);
|
|
5
|
-
}
|
|
6
|
-
function isNotNullish(val) {
|
|
7
|
-
return !isNullish(val);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
nullishValues,
|
|
12
|
-
isNullish,
|
|
13
|
-
isNotNullish
|
|
14
|
-
};
|
package/chunks/chunk-HGCG2J77.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
matchesSome
|
|
3
|
-
} from "./chunk-LQFKUNVQ.js";
|
|
4
|
-
|
|
5
|
-
// src/node/files/subpaths/index.ts
|
|
6
|
-
import { promises as fs } from "node:fs";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
var Subpaths;
|
|
9
|
-
((Subpaths2) => {
|
|
10
|
-
Subpaths2.defaultListContext = {
|
|
11
|
-
depth: 0,
|
|
12
|
-
lstats: null,
|
|
13
|
-
rootPath: null
|
|
14
|
-
};
|
|
15
|
-
Subpaths2.fillListContext = (input) => {
|
|
16
|
-
return {
|
|
17
|
-
...Subpaths2.defaultListContext,
|
|
18
|
-
...input
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
Subpaths2.defaultListOptions = {
|
|
22
|
-
directories: true,
|
|
23
|
-
files: true,
|
|
24
|
-
symlinks: true,
|
|
25
|
-
hidden: true,
|
|
26
|
-
followSimlinks: false,
|
|
27
|
-
dedupeSimlinksContents: false,
|
|
28
|
-
maxDepth: Infinity,
|
|
29
|
-
returnRelative: false,
|
|
30
|
-
exclude: null,
|
|
31
|
-
include: null,
|
|
32
|
-
filter: () => true
|
|
33
|
-
};
|
|
34
|
-
Subpaths2.fillOptions = (input) => {
|
|
35
|
-
return {
|
|
36
|
-
...Subpaths2.defaultListOptions,
|
|
37
|
-
...input
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
async function list(...args) {
|
|
41
|
-
const [inputPath, _options] = args;
|
|
42
|
-
const options = (0, Subpaths2.fillOptions)(_options ?? {});
|
|
43
|
-
const subpaths = await listAbsoluteSubpaths(...args);
|
|
44
|
-
return options.returnRelative ? subpaths.map((subpath) => path.relative(inputPath, subpath)) : subpaths;
|
|
45
|
-
}
|
|
46
|
-
Subpaths2.list = list;
|
|
47
|
-
async function listAbsoluteSubpaths(inputPath, _options = {}, __private_context = {}) {
|
|
48
|
-
const options = (0, Subpaths2.fillOptions)(_options);
|
|
49
|
-
const _private_context = (0, Subpaths2.fillListContext)(__private_context);
|
|
50
|
-
if (_private_context.rootPath === null) {
|
|
51
|
-
_private_context.rootPath = inputPath;
|
|
52
|
-
}
|
|
53
|
-
const subpaths = [];
|
|
54
|
-
if (_private_context.depth > options.maxDepth) return subpaths;
|
|
55
|
-
try {
|
|
56
|
-
const pathStat = _private_context.lstats ?? await fs.lstat(inputPath);
|
|
57
|
-
if (!pathStat.isDirectory()) return subpaths;
|
|
58
|
-
} catch (err) {
|
|
59
|
-
return subpaths;
|
|
60
|
-
}
|
|
61
|
-
const childrenRelPaths = await fs.readdir(inputPath);
|
|
62
|
-
await Promise.all(childrenRelPaths.map(async (childRelPath) => {
|
|
63
|
-
const childAbsPath = path.join(inputPath, childRelPath);
|
|
64
|
-
const childRelFromRootPath = path.relative(_private_context.rootPath ?? inputPath, childAbsPath);
|
|
65
|
-
const childLstats = await fs.lstat(childAbsPath);
|
|
66
|
-
try {
|
|
67
|
-
const isDirectory = childLstats.isDirectory();
|
|
68
|
-
const isSymlink = childLstats.isSymbolicLink();
|
|
69
|
-
const isFile = !isDirectory && !isSymlink;
|
|
70
|
-
const isHidden = path.basename(childAbsPath).startsWith(".");
|
|
71
|
-
const type = isDirectory ? "directory" : isSymlink ? "symlink" : "file";
|
|
72
|
-
if (isDirectory && options.directories === false) throw true;
|
|
73
|
-
if (isSymlink && options.symlinks === false) throw false;
|
|
74
|
-
if (isFile && options.files === false) throw false;
|
|
75
|
-
if (isHidden && options.hidden === false) throw false;
|
|
76
|
-
const realPath = isSymlink ? await fs.realpath(childAbsPath) : childAbsPath;
|
|
77
|
-
const childPathForFilters = options.returnRelative ? childRelFromRootPath : childAbsPath;
|
|
78
|
-
const isInExclude = matchesSome(childPathForFilters, options.exclude ?? []);
|
|
79
|
-
const isInInclude = matchesSome(childPathForFilters, options.include ?? []);
|
|
80
|
-
if (isInExclude && !isInInclude) throw false;
|
|
81
|
-
const isInFilter = await options.filter(childPathForFilters, { type, hidden: isHidden, realPath });
|
|
82
|
-
if (!isInFilter) throw true;
|
|
83
|
-
if (isSymlink) {
|
|
84
|
-
if (options.followSimlinks === false) subpaths.push(childAbsPath);
|
|
85
|
-
else {
|
|
86
|
-
const childSubpaths = await listAbsoluteSubpaths(realPath, options, {
|
|
87
|
-
..._private_context,
|
|
88
|
-
depth: _private_context.depth + 1
|
|
89
|
-
});
|
|
90
|
-
subpaths.push(realPath, ...childSubpaths);
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
if (isDirectory) {
|
|
94
|
-
const childSubpaths = await listAbsoluteSubpaths(childAbsPath, options, {
|
|
95
|
-
..._private_context,
|
|
96
|
-
depth: _private_context.depth + 1,
|
|
97
|
-
lstats: childLstats
|
|
98
|
-
});
|
|
99
|
-
subpaths.push(childAbsPath, ...childSubpaths);
|
|
100
|
-
} else {
|
|
101
|
-
subpaths.push(childAbsPath);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
} catch (err) {
|
|
105
|
-
if (typeof err !== "boolean") throw new Error(`This try/catch block should only throw booleans`);
|
|
106
|
-
const shouldDiveDeeper = err;
|
|
107
|
-
if (!shouldDiveDeeper) return [];
|
|
108
|
-
const childSubpaths = await listAbsoluteSubpaths(childAbsPath, options, {
|
|
109
|
-
..._private_context,
|
|
110
|
-
depth: _private_context.depth + 1,
|
|
111
|
-
lstats: childLstats
|
|
112
|
-
});
|
|
113
|
-
subpaths.push(...childSubpaths);
|
|
114
|
-
}
|
|
115
|
-
}));
|
|
116
|
-
return options.dedupeSimlinksContents ? Array.from(new Set(subpaths)) : subpaths;
|
|
117
|
-
}
|
|
118
|
-
})(Subpaths || (Subpaths = {}));
|
|
119
|
-
|
|
120
|
-
export {
|
|
121
|
-
Subpaths
|
|
122
|
-
};
|