@mxfb/tools 0.3.0 → 1.0.2

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.
Files changed (255) hide show
  1. package/TODO.md +1 -0
  2. package/agnostic/@publisher/index.d.ts +47 -0
  3. package/agnostic/@publisher/index.js +361 -0
  4. package/agnostic/elo/index.d.ts +23 -0
  5. package/agnostic/elo/index.js +28 -0
  6. package/agnostic/elo/index.test.d.ts +1 -0
  7. package/agnostic/elo/index.test.js +67 -0
  8. package/agnostic/index.d.ts +5 -4
  9. package/agnostic/index.js +5 -0
  10. package/agnostic/poetry/generate-rhymes/index.d.ts +1 -0
  11. package/agnostic/poetry/generate-rhymes/index.js +125 -0
  12. package/agnostic/poetry/index.d.ts +1 -0
  13. package/agnostic/poetry/index.js +1 -0
  14. package/agnostic/scrapers/@meteociel/index.d.ts +36 -0
  15. package/agnostic/scrapers/@meteociel/index.js +248 -0
  16. package/agnostic/scrapers/@meteociel/index.test.d.ts +1 -0
  17. package/agnostic/scrapers/@meteociel/index.test.js +43 -0
  18. package/agnostic/scrapers/@meteociel/locations/index.d.ts +11 -0
  19. package/agnostic/scrapers/@meteociel/locations/index.js +10 -0
  20. package/agnostic/scrapers/@meteociel/types.d.ts +1 -0
  21. package/agnostic/scrapers/@meteociel/types.js +1 -0
  22. package/agnostic/scrapers/@tumblr/blogs/delabienbonnemusique/index.d.ts +22 -0
  23. package/agnostic/scrapers/@tumblr/blogs/delabienbonnemusique/index.js +124 -0
  24. package/agnostic/scrapers/@tumblr/blogs/delabienbonnemusique/index.test.d.ts +1 -0
  25. package/agnostic/scrapers/@tumblr/blogs/delabienbonnemusique/index.test.js +107 -0
  26. package/agnostic/scrapers/@tumblr/blogs/index.d.ts +8 -0
  27. package/agnostic/scrapers/@tumblr/blogs/index.js +23 -0
  28. package/agnostic/scrapers/@tumblr/index.d.ts +73 -0
  29. package/agnostic/scrapers/@tumblr/index.js +180 -0
  30. package/agnostic/scrapers/@tumblr/index.test.d.ts +1 -0
  31. package/agnostic/scrapers/@tumblr/index.test.js +319 -0
  32. package/agnostic/scrapers/@tumblr/types.d.ts +238 -0
  33. package/agnostic/scrapers/@tumblr/types.js +38 -0
  34. package/agnostic/scrapers/@tumblr/utils.d.ts +12 -0
  35. package/agnostic/scrapers/@tumblr/utils.js +407 -0
  36. package/agnostic/scrapers/index.d.ts +2 -0
  37. package/agnostic/scrapers/index.js +2 -0
  38. package/agnostic/weather/index.d.ts +1 -0
  39. package/agnostic/weather/index.js +1 -0
  40. package/agnostic/weather/types.d.ts +181 -0
  41. package/agnostic/weather/types.js +8 -0
  42. package/components/index.d.ts +1 -1
  43. package/components/index.js +1 -0
  44. package/components/public-classnames.d.ts +5 -0
  45. package/components/public-classnames.js +5 -0
  46. package/components/utils/index.d.ts +1 -0
  47. package/components/utils/index.js +12 -0
  48. package/components/utils/types.d.ts +3 -0
  49. package/components/utils/types.js +1 -0
  50. package/index.d.ts +3 -3
  51. package/index.js +3 -0
  52. package/node/headless-browser/index.d.ts +37 -0
  53. package/node/headless-browser/index.js +126 -0
  54. package/node/headless-browser/types.d.ts +47 -0
  55. package/node/headless-browser/types.js +5 -0
  56. package/node/index.d.ts +1 -2
  57. package/node/index.js +1 -0
  58. package/node/index.test.d.ts +1 -0
  59. package/node/index.test.js +6 -0
  60. package/node/scrapers/@tumblr/index.d.ts +61 -0
  61. package/node/scrapers/@tumblr/index.js +182 -0
  62. package/node/scrapers/@tumblr/index.test.d.ts +1 -0
  63. package/node/scrapers/@tumblr/index.test.js +185 -0
  64. package/node/scrapers/@tumblr/types.d.ts +91 -0
  65. package/node/scrapers/@tumblr/types.js +1 -0
  66. package/node/scrapers/@tumblr/utils.d.ts +23 -0
  67. package/node/scrapers/@tumblr/utils.js +328 -0
  68. package/node/scrapers/index.d.ts +1 -0
  69. package/node/scrapers/index.js +1 -0
  70. package/package.json +211 -14
  71. package/agnostic/_WIP_tennis/index.d.ts +0 -2
  72. package/agnostic/_WIP_tennis/index.js +0 -62
  73. package/agnostic/arrays/index.d.ts +0 -11
  74. package/agnostic/arrays/is-array-of/index.d.ts +0 -5
  75. package/agnostic/arrays/is-array-of/index.js +0 -23
  76. package/agnostic/async/index.d.ts +0 -8
  77. package/agnostic/async/index.js +0 -20
  78. package/agnostic/async/timeout-call/index.d.ts +0 -1
  79. package/agnostic/async/timeout-call/index.js +0 -6
  80. package/agnostic/async/transitions/index.d.ts +0 -41
  81. package/agnostic/async/transitions/index.js +0 -7
  82. package/agnostic/async/wait/index.d.ts +0 -1
  83. package/agnostic/async/wait/index.js +0 -6
  84. package/agnostic/booleans/index.d.ts +0 -8
  85. package/agnostic/booleans/index.js +0 -17
  86. package/agnostic/booleans/is-falsy/index.d.ts +0 -7
  87. package/agnostic/booleans/is-falsy/index.js +0 -11
  88. package/agnostic/css/bem/BEM.d.ts +0 -29
  89. package/agnostic/css/bem/getNamesArr.d.ts +0 -2
  90. package/agnostic/css/bem/index.d.ts +0 -7
  91. package/agnostic/css/bem/index.js +0 -9
  92. package/agnostic/css/generate-nice-color/index.d.ts +0 -2
  93. package/agnostic/css/generate-nice-color/index.js +0 -8
  94. package/agnostic/css/index.d.ts +0 -14
  95. package/agnostic/css/index.js +0 -177
  96. package/agnostic/css/is-valid-css-class-name/index.d.ts +0 -2
  97. package/agnostic/css/is-valid-css-class-name/index.js +0 -8
  98. package/agnostic/css/styles-set/index.d.ts +0 -37
  99. package/agnostic/errors/index.d.ts +0 -30
  100. package/agnostic/errors/index.js +0 -6
  101. package/agnostic/html/get-node-ancestors/index.d.ts +0 -1
  102. package/agnostic/html/get-node-ancestors/index.js +0 -6
  103. package/agnostic/html/get-position-inside-parent/index.d.ts +0 -1
  104. package/agnostic/html/get-position-inside-parent/index.js +0 -6
  105. package/agnostic/html/index.d.ts +0 -17
  106. package/agnostic/html/index.js +0 -39
  107. package/agnostic/html/insert-node/index.d.ts +0 -2
  108. package/agnostic/html/insert-node/index.js +0 -6
  109. package/agnostic/html/placeholders/index.d.ts +0 -9
  110. package/agnostic/html/placeholders/index.js +0 -6
  111. package/agnostic/html/sanitize/index.d.ts +0 -24
  112. package/agnostic/html/sanitize/index.js +0 -9
  113. package/agnostic/html/selector-to-element/index.d.ts +0 -1
  114. package/agnostic/html/selector-to-element/index.js +0 -9
  115. package/agnostic/html/string-to-nodes/index.d.ts +0 -7
  116. package/agnostic/html/string-to-nodes/index.js +0 -10
  117. package/agnostic/misc/assert/index.d.ts +0 -5
  118. package/agnostic/misc/assert/index.js +0 -6
  119. package/agnostic/misc/cast/index.d.ts +0 -9
  120. package/agnostic/misc/cast/index.js +0 -8
  121. package/agnostic/misc/crossenv/index.d.ts +0 -13
  122. package/agnostic/misc/crossenv/index.js +0 -6
  123. package/agnostic/misc/elo/index.d.ts +0 -31
  124. package/agnostic/misc/elo/index.js +0 -6
  125. package/agnostic/misc/get-current-downlink/index.d.ts +0 -1
  126. package/agnostic/misc/get-current-downlink/index.js +0 -6
  127. package/agnostic/misc/index.d.ts +0 -6
  128. package/agnostic/misc/index.js +0 -16
  129. package/agnostic/misc/is-constructor-function/index.d.ts +0 -2
  130. package/agnostic/misc/is-constructor-function/index.js +0 -6
  131. package/agnostic/misc/is-nullish/index.d.ts +0 -4
  132. package/agnostic/misc/is-nullish/index.js +0 -10
  133. package/agnostic/misc/logs/index.d.ts +0 -55
  134. package/agnostic/misc/logs/index.js +0 -6
  135. package/agnostic/misc/random/index.d.ts +0 -10
  136. package/agnostic/misc/random/index.js +0 -6
  137. package/agnostic/misc/tennis/index.d.ts +0 -60
  138. package/agnostic/misc/tennis/index.js +0 -6
  139. package/agnostic/numbers/absolute-modulo/index.d.ts +0 -1
  140. package/agnostic/numbers/absolute-modulo/index.js +0 -6
  141. package/agnostic/numbers/clamp/index.d.ts +0 -1
  142. package/agnostic/numbers/clamp/index.js +0 -6
  143. package/agnostic/numbers/index.d.ts +0 -13
  144. package/agnostic/numbers/index.js +0 -30
  145. package/agnostic/numbers/interpolate/index.d.ts +0 -1
  146. package/agnostic/numbers/interpolate/index.js +0 -6
  147. package/agnostic/numbers/responsive-harmonics/index.d.ts +0 -10
  148. package/agnostic/numbers/responsive-harmonics/index.js +0 -9
  149. package/agnostic/numbers/round/index.d.ts +0 -1
  150. package/agnostic/numbers/round/index.js +0 -6
  151. package/agnostic/objects/enums/index.d.ts +0 -4
  152. package/agnostic/objects/enums/index.js +0 -7
  153. package/agnostic/objects/enums/is-in-enum/index.d.ts +0 -1
  154. package/agnostic/objects/enums/is-in-enum/index.js +0 -6
  155. package/agnostic/objects/flatten-getters/index.d.ts +0 -1
  156. package/agnostic/objects/flatten-getters/index.js +0 -9
  157. package/agnostic/objects/index.d.ts +0 -12
  158. package/agnostic/objects/index.js +0 -32
  159. package/agnostic/objects/is-object/index.d.ts +0 -1
  160. package/agnostic/objects/is-object/index.js +0 -6
  161. package/agnostic/objects/is-record/index.d.ts +0 -1
  162. package/agnostic/objects/is-record/index.js +0 -6
  163. package/agnostic/objects/record-format/index.d.ts +0 -11
  164. package/agnostic/objects/record-format/index.js +0 -16
  165. package/agnostic/objects/validation/index.d.ts +0 -3
  166. package/agnostic/objects/validation/index.js +0 -6
  167. package/agnostic/optim/index.d.ts +0 -7
  168. package/agnostic/optim/index.js +0 -18
  169. package/agnostic/optim/memoize/index.d.ts +0 -3
  170. package/agnostic/optim/memoize/index.js +0 -6
  171. package/agnostic/optim/throttle-debounce/index.d.ts +0 -30
  172. package/agnostic/optim/throttle-debounce/index.js +0 -8
  173. package/agnostic/optim/throttle-debounce/types.d.ts +0 -2
  174. package/agnostic/regexps/index.d.ts +0 -23
  175. package/agnostic/regexps/index.js +0 -89
  176. package/agnostic/strings/char-codes/index.d.ts +0 -17
  177. package/agnostic/strings/char-codes/index.js +0 -6
  178. package/agnostic/strings/index.d.ts +0 -14
  179. package/agnostic/strings/index.js +0 -32
  180. package/agnostic/strings/matches/index.d.ts +0 -3
  181. package/agnostic/strings/matches/index.js +0 -10
  182. package/agnostic/strings/normalize-indent/index.d.ts +0 -1
  183. package/agnostic/strings/normalize-indent/index.js +0 -6
  184. package/agnostic/strings/replace-all/index.d.ts +0 -1
  185. package/agnostic/strings/replace-all/index.js +0 -6
  186. package/agnostic/strings/to-alphanum/index.d.ts +0 -1
  187. package/agnostic/strings/to-alphanum/index.js +0 -6
  188. package/chunks/chunk-32IRF4OP.js +0 -9
  189. package/chunks/chunk-34U4HX4V.js +0 -73
  190. package/chunks/chunk-4GDNHUCZ.js +0 -162
  191. package/chunks/chunk-4QQBKBYH.js +0 -59
  192. package/chunks/chunk-4VC5PT5T.js +0 -13
  193. package/chunks/chunk-5LNUCDQ6.js +0 -132
  194. package/chunks/chunk-7AWTHZLY.js +0 -12
  195. package/chunks/chunk-7DBNMU6N.js +0 -14
  196. package/chunks/chunk-COVPTTAD.js +0 -10
  197. package/chunks/chunk-DNIOWD7K.js +0 -8
  198. package/chunks/chunk-DQNJQBC6.js +0 -10
  199. package/chunks/chunk-E6MSDKON.js +0 -13
  200. package/chunks/chunk-EDVNAV3G.js +0 -72
  201. package/chunks/chunk-EW46EXFB.js +0 -8
  202. package/chunks/chunk-FPEW3A27.js +0 -14
  203. package/chunks/chunk-GJOU3UAL.js +0 -36
  204. package/chunks/chunk-HC6ZOHCS.js +0 -14
  205. package/chunks/chunk-HGCG2J77.js +0 -122
  206. package/chunks/chunk-IFD7GSGK.js +0 -130
  207. package/chunks/chunk-JQXNEJAP.js +0 -18
  208. package/chunks/chunk-JWBDZPQG.js +0 -18
  209. package/chunks/chunk-K37RALUX.js +0 -8
  210. package/chunks/chunk-KIONYWA7.js +0 -168
  211. package/chunks/chunk-KQT5CTGF.js +0 -21
  212. package/chunks/chunk-LEXQ6E6L.js +0 -31
  213. package/chunks/chunk-LQFKUNVQ.js +0 -19
  214. package/chunks/chunk-MF56TTC5.js +0 -15
  215. package/chunks/chunk-MT74WIQR.js +0 -41
  216. package/chunks/chunk-NRITRUZW.js +0 -10
  217. package/chunks/chunk-NRJQKVQV.js +0 -31
  218. package/chunks/chunk-OSAXBA7G.js +0 -10
  219. package/chunks/chunk-PO3V3I57.js +0 -23
  220. package/chunks/chunk-QXAJXTXV.js +0 -19
  221. package/chunks/chunk-RCO57B6F.js +0 -9
  222. package/chunks/chunk-SQZGZ3VT.js +0 -15
  223. package/chunks/chunk-TTZHPIH7.js +0 -237
  224. package/chunks/chunk-UYTXXUU7.js +0 -54
  225. package/chunks/chunk-VTPRO4NJ.js +0 -10
  226. package/chunks/chunk-VYW4IADX.js +0 -35
  227. package/chunks/chunk-VZDUZTW6.js +0 -113
  228. package/chunks/chunk-W5A2TON3.js +0 -10
  229. package/chunks/chunk-W7YBGJ4H.js +0 -28
  230. package/chunks/chunk-WLL3FNVL.js +0 -40
  231. package/chunks/chunk-WOAYU6LB.js +0 -13
  232. package/chunks/chunk-XA4HVHJ4.js +0 -18
  233. package/chunks/chunk-XN3PZIVL.js +0 -38
  234. package/chunks/chunk-Y3OZHZUF.js +0 -237
  235. package/chunks/chunk-YDIBNEGA.js +0 -9
  236. package/chunks/chunk-ZC5RZBNY.js +0 -33
  237. package/components/Comp/index.d.ts +0 -1
  238. package/node/files/index.d.ts +0 -9
  239. package/node/files/index.js +0 -21
  240. package/node/files/is-in-directory/index.d.ts +0 -1
  241. package/node/files/is-in-directory/index.js +0 -6
  242. package/node/files/read-write/index.d.ts +0 -9
  243. package/node/files/read-write/index.js +0 -6
  244. package/node/files/subpaths/index.d.ts +0 -34
  245. package/node/files/subpaths/index.js +0 -7
  246. package/node/image/index.d.ts +0 -9
  247. package/node/image/index.js +0 -74
  248. package/node/mxfb-cli-config/index.d.ts +0 -19
  249. package/node/mxfb-cli-config/index.js +0 -113
  250. package/node/process/index.d.ts +0 -8
  251. package/node/process/index.js +0 -20
  252. package/node/process/on-exit/index.d.ts +0 -5
  253. package/node/process/on-exit/index.js +0 -14
  254. package/shared/errors/index.d.ts +0 -138
  255. package/shared/index.d.ts +0 -0
@@ -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
- };
@@ -1,8 +0,0 @@
1
- // src/agnostic/numbers/interpolate/index.ts
2
- function interpolate(ratio, bound1, bound2) {
3
- return bound1 + ratio * (bound2 - bound1);
4
- }
5
-
6
- export {
7
- interpolate
8
- };
@@ -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
- };
@@ -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
- };
@@ -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
- };
@@ -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
- };
@@ -1,130 +0,0 @@
1
- import {
2
- register
3
- } from "./chunk-KQT5CTGF.js";
4
- import {
5
- Crossenv
6
- } from "./chunk-GJOU3UAL.js";
7
-
8
- // src/agnostic/html/sanitize/index.ts
9
- var Sanitize;
10
- ((Sanitize2) => {
11
- Sanitize2.defaultOptions = { depth: 20 };
12
- function sanitize(inputStr, options = Sanitize2.defaultOptions) {
13
- const actualDocument = options.documentObj ?? Crossenv.getDocument();
14
- if (actualDocument === null) throw register.getError("no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */, "See documentObj in the options object");
15
- const wrapperDiv = actualDocument.createElement("div");
16
- const { inputFreeTransform } = options;
17
- wrapperDiv.innerHTML = inputFreeTransform !== void 0 ? inputFreeTransform(inputStr) : inputStr;
18
- const sanitizedWrapper = sanitizeElement(wrapperDiv, options);
19
- const returned = sanitizedWrapper?.innerHTML;
20
- return returned ?? "";
21
- }
22
- Sanitize2.sanitize = sanitize;
23
- function sanitizeElement(element, options = Sanitize2.defaultOptions) {
24
- const actualDocument = options.documentObj ?? Crossenv.getDocument();
25
- if (actualDocument === null) throw register.getError("no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */, "See documentObj in the options object");
26
- const { tagName, attributes, childNodes } = element;
27
- const {
28
- allowedTags = [],
29
- allowedAttributes = {},
30
- forbiddenTags = [],
31
- forbiddenAttributes = {},
32
- depth = 20,
33
- verbose = false
34
- } = options;
35
- if (depth <= 0) {
36
- console.warn("Max depth reached");
37
- return null;
38
- }
39
- const normalizedTagName = tagName.toLowerCase().trim();
40
- const tagIsInForbidden = forbiddenTags.includes("*") || forbiddenTags.includes(normalizedTagName);
41
- if (tagIsInForbidden) {
42
- if (verbose === true) console.warn(tagName, "tag is forbidden");
43
- return null;
44
- }
45
- const tagIsInAllowed = allowedTags.includes("*") || allowedTags.includes(normalizedTagName);
46
- if (!tagIsInAllowed) {
47
- if (verbose === true) console.warn(tagName, "tag is not allowed");
48
- return null;
49
- }
50
- const returnedElement = actualDocument.createElement(tagName);
51
- const returnedAttributes = Array.from(attributes).filter(({ name: attributeName, value: attributeValue }) => {
52
- const allTagsForbiddenAttributes = forbiddenAttributes["*"] ?? [];
53
- const thisTagForbiddenAttributes = forbiddenAttributes[normalizedTagName] ?? [];
54
- const mergedForbiddenAttributes = [...allTagsForbiddenAttributes, ...thisTagForbiddenAttributes];
55
- const isInForbidden = mergedForbiddenAttributes.some(({
56
- attributeName: nameTester,
57
- attributeValues: valTesters
58
- }) => {
59
- if (typeof nameTester === "string" && nameTester !== "*" && attributeName !== nameTester) return false;
60
- if (typeof nameTester !== "string" && !nameTester.test(attributeName)) return false;
61
- if (valTesters === void 0) {
62
- if (verbose === true) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
63
- return true;
64
- }
65
- if (valTesters.includes("*")) {
66
- if (verbose === true) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
67
- return true;
68
- }
69
- return valTesters.some((valTester) => {
70
- if (typeof valTester === "string" && attributeValue === valTester) {
71
- if (verbose === true) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
72
- return true;
73
- }
74
- if (typeof valTester !== "string" && valTester.test(attributeValue)) {
75
- if (verbose === true) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
76
- return true;
77
- }
78
- return false;
79
- });
80
- });
81
- if (isInForbidden) return false;
82
- const allTagsAllowedAttributes = allowedAttributes["*"] ?? [];
83
- const thisTagAllowedAttributes = allowedAttributes[normalizedTagName] ?? [];
84
- const mergedAllowedAttributes = [...allTagsAllowedAttributes, ...thisTagAllowedAttributes];
85
- let latestNotAllowedReason = [tagName, "has no allowed attributes"];
86
- const isInAllowed = mergedAllowedAttributes.some(({
87
- attributeName: nameTester,
88
- attributeValues: valTesters
89
- }) => {
90
- if (typeof nameTester === "string" && nameTester !== "*" && attributeName !== nameTester) {
91
- latestNotAllowedReason = [attributeName, "attribute on", tagName, "tag is not allowed"];
92
- return false;
93
- }
94
- if (typeof nameTester !== "string" && !nameTester.test(attributeName)) {
95
- latestNotAllowedReason = [attributeName, "attribute on", tagName, "tag is not allowed"];
96
- return false;
97
- }
98
- if (valTesters === void 0) return true;
99
- if (valTesters.includes("*")) return true;
100
- return valTesters.some((valTester) => {
101
- if (typeof valTester === "string" && attributeValue === valTester) return true;
102
- if (typeof valTester !== "string" && valTester.test(attributeValue)) return true;
103
- latestNotAllowedReason = [attributeValue, "value for", attributeName, "attribute on", tagName, "tag is not allowed"];
104
- return false;
105
- });
106
- });
107
- if (!isInAllowed) {
108
- if (verbose === true) console.warn(...latestNotAllowedReason);
109
- return false;
110
- }
111
- return true;
112
- });
113
- returnedAttributes.forEach(({ name, value }) => {
114
- returnedElement.setAttribute(name, value);
115
- });
116
- const sanitizedChildNodes = Array.from(childNodes).map((node) => {
117
- if (node.nodeType === Node.ELEMENT_NODE) return sanitizeElement(node, { ...options, depth: depth - 1 });
118
- else if (node.nodeType === Node.TEXT_NODE) return node;
119
- else if (options.keepComments === true && node.nodeType === Node.COMMENT_NODE) return node;
120
- return null;
121
- }).filter((elt) => elt !== null);
122
- returnedElement.replaceChildren(...sanitizedChildNodes);
123
- return returnedElement;
124
- }
125
- Sanitize2.sanitizeElement = sanitizeElement;
126
- })(Sanitize || (Sanitize = {}));
127
-
128
- export {
129
- Sanitize
130
- };
@@ -1,18 +0,0 @@
1
- // src/agnostic/strings/normalize-indent/index.ts
2
- function normalizeIndent(input, indentLevel = 0) {
3
- const indent = " ".repeat(indentLevel);
4
- const lines = input.split("\n");
5
- const noIndentLines = lines.map((line) => line.replace(/^\s*/igm, ""));
6
- const pipeReplacedLines = noIndentLines.map((line) => {
7
- const nbPipeCharsOnLineStart = line.match(/^\|+/igm)?.[0].length ?? 0;
8
- const noPipeLine = line.slice(nbPipeCharsOnLineStart);
9
- const replacedPipes = " ".repeat(nbPipeCharsOnLineStart);
10
- return replacedPipes + noPipeLine;
11
- });
12
- const normalizedLines = pipeReplacedLines.map((line) => indent + line);
13
- return normalizedLines.join("\n");
14
- }
15
-
16
- export {
17
- normalizeIndent
18
- };
@@ -1,18 +0,0 @@
1
- // src/agnostic/optim/memoize/index.ts
2
- function memoize(toMemoizeFunc) {
3
- let cachedArgs = void 0;
4
- let cachedResult = void 0;
5
- return function memoized(...args) {
6
- const allArgsAreInCache = cachedArgs !== void 0 && args.every((arg, argPos) => cachedArgs[argPos] === arg);
7
- const allCachedAreInArgs = cachedArgs !== void 0 && cachedArgs.every((arg, argPos) => args[argPos] === arg);
8
- const returnCache = allArgsAreInCache && allCachedAreInArgs;
9
- if (returnCache) return cachedResult;
10
- const result = toMemoizeFunc(...args);
11
- cachedResult = result;
12
- return result;
13
- };
14
- }
15
-
16
- export {
17
- memoize
18
- };
@@ -1,8 +0,0 @@
1
- // src/agnostic/objects/is-object/index.ts
2
- function isObject(unk) {
3
- return typeof unk === "object" && unk !== null;
4
- }
5
-
6
- export {
7
- isObject
8
- };
@@ -1,168 +0,0 @@
1
- import {
2
- isValidClassName
3
- } from "./chunk-W5A2TON3.js";
4
- import {
5
- isFalsy
6
- } from "./chunk-QXAJXTXV.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
- };
@@ -1,21 +0,0 @@
1
- import {
2
- Crossenv
3
- } from "./chunk-GJOU3UAL.js";
4
- import {
5
- Errors
6
- } from "./chunk-MT74WIQR.js";
7
-
8
- // src/shared/errors/index.ts
9
- var register = new Errors.Register({
10
- ["no-window-document-on-runtime" /* NO_DOCUMENT */]: {
11
- message: `Runtime '${Crossenv.detectRuntime()}' does not provide a Document object, cannot complete.`
12
- },
13
- ["no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */]: {
14
- message: `Please provide a Document object since none are found on runtime '${Crossenv.detectRuntime()}'`,
15
- makeDetails: (tips) => tips
16
- }
17
- });
18
-
19
- export {
20
- register
21
- };
@@ -1,31 +0,0 @@
1
- // src/node/process/on-exit/index.ts
2
- var forceExitEvents = ["SIGINT", "SIGTERM", "uncaughtException"];
3
- function beforeForcedExit(callback) {
4
- forceExitEvents.forEach((ev) => process.on(ev, callback));
5
- }
6
- function beforeExit(callback) {
7
- process.on("beforeExit", callback);
8
- }
9
- function onExit(callback) {
10
- process.on("exit", callback);
11
- }
12
- function onAllExits(callback) {
13
- let alreadyCalled = false;
14
- const actualCallback = () => {
15
- if (!alreadyCalled) {
16
- alreadyCalled = true;
17
- callback();
18
- }
19
- };
20
- beforeForcedExit(actualCallback);
21
- beforeExit(actualCallback);
22
- onExit(actualCallback);
23
- }
24
-
25
- export {
26
- forceExitEvents,
27
- beforeForcedExit,
28
- beforeExit,
29
- onExit,
30
- onAllExits
31
- };