@mxfb/tools 0.3.0 → 1.0.0

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 (201) hide show
  1. package/agnostic/scrapers/@meteociel/index.d.ts +36 -0
  2. package/agnostic/scrapers/@meteociel/index.js +194 -0
  3. package/agnostic/scrapers/@meteociel/index.test.d.ts +1 -0
  4. package/agnostic/scrapers/@meteociel/locations/index.d.ts +11 -0
  5. package/agnostic/scrapers/@meteociel/locations/index.js +6 -0
  6. package/agnostic/scrapers/@meteociel/types.d.ts +1 -0
  7. package/agnostic/weather/types.d.ts +181 -0
  8. package/agnostic/weather/types.js +0 -0
  9. package/chunks/chunk-JQLUR5LO.js +12 -0
  10. package/components/Comp/index.d.ts +1 -1
  11. package/components/Comp/index.js +0 -0
  12. package/node/index.d.ts +1 -2
  13. package/node/index.js +0 -0
  14. package/package.json +45 -14
  15. package/agnostic/_WIP_tennis/index.d.ts +0 -2
  16. package/agnostic/_WIP_tennis/index.js +0 -62
  17. package/agnostic/arrays/index.d.ts +0 -11
  18. package/agnostic/arrays/is-array-of/index.d.ts +0 -5
  19. package/agnostic/arrays/is-array-of/index.js +0 -23
  20. package/agnostic/async/index.d.ts +0 -8
  21. package/agnostic/async/index.js +0 -20
  22. package/agnostic/async/timeout-call/index.d.ts +0 -1
  23. package/agnostic/async/timeout-call/index.js +0 -6
  24. package/agnostic/async/transitions/index.d.ts +0 -41
  25. package/agnostic/async/transitions/index.js +0 -7
  26. package/agnostic/async/wait/index.d.ts +0 -1
  27. package/agnostic/async/wait/index.js +0 -6
  28. package/agnostic/booleans/index.d.ts +0 -8
  29. package/agnostic/booleans/index.js +0 -17
  30. package/agnostic/booleans/is-falsy/index.d.ts +0 -7
  31. package/agnostic/booleans/is-falsy/index.js +0 -11
  32. package/agnostic/css/bem/BEM.d.ts +0 -29
  33. package/agnostic/css/bem/getNamesArr.d.ts +0 -2
  34. package/agnostic/css/bem/index.d.ts +0 -7
  35. package/agnostic/css/bem/index.js +0 -9
  36. package/agnostic/css/generate-nice-color/index.d.ts +0 -2
  37. package/agnostic/css/generate-nice-color/index.js +0 -8
  38. package/agnostic/css/index.d.ts +0 -14
  39. package/agnostic/css/index.js +0 -177
  40. package/agnostic/css/is-valid-css-class-name/index.d.ts +0 -2
  41. package/agnostic/css/is-valid-css-class-name/index.js +0 -8
  42. package/agnostic/css/styles-set/index.d.ts +0 -37
  43. package/agnostic/errors/index.d.ts +0 -30
  44. package/agnostic/errors/index.js +0 -6
  45. package/agnostic/html/get-node-ancestors/index.d.ts +0 -1
  46. package/agnostic/html/get-node-ancestors/index.js +0 -6
  47. package/agnostic/html/get-position-inside-parent/index.d.ts +0 -1
  48. package/agnostic/html/get-position-inside-parent/index.js +0 -6
  49. package/agnostic/html/index.d.ts +0 -17
  50. package/agnostic/html/index.js +0 -39
  51. package/agnostic/html/insert-node/index.d.ts +0 -2
  52. package/agnostic/html/insert-node/index.js +0 -6
  53. package/agnostic/html/placeholders/index.d.ts +0 -9
  54. package/agnostic/html/placeholders/index.js +0 -6
  55. package/agnostic/html/sanitize/index.d.ts +0 -24
  56. package/agnostic/html/sanitize/index.js +0 -9
  57. package/agnostic/html/selector-to-element/index.d.ts +0 -1
  58. package/agnostic/html/selector-to-element/index.js +0 -9
  59. package/agnostic/html/string-to-nodes/index.d.ts +0 -7
  60. package/agnostic/html/string-to-nodes/index.js +0 -10
  61. package/agnostic/index.d.ts +0 -4
  62. package/agnostic/misc/assert/index.d.ts +0 -5
  63. package/agnostic/misc/assert/index.js +0 -6
  64. package/agnostic/misc/cast/index.d.ts +0 -9
  65. package/agnostic/misc/cast/index.js +0 -8
  66. package/agnostic/misc/crossenv/index.d.ts +0 -13
  67. package/agnostic/misc/crossenv/index.js +0 -6
  68. package/agnostic/misc/elo/index.d.ts +0 -31
  69. package/agnostic/misc/elo/index.js +0 -6
  70. package/agnostic/misc/get-current-downlink/index.d.ts +0 -1
  71. package/agnostic/misc/get-current-downlink/index.js +0 -6
  72. package/agnostic/misc/index.d.ts +0 -6
  73. package/agnostic/misc/index.js +0 -16
  74. package/agnostic/misc/is-constructor-function/index.d.ts +0 -2
  75. package/agnostic/misc/is-constructor-function/index.js +0 -6
  76. package/agnostic/misc/is-nullish/index.d.ts +0 -4
  77. package/agnostic/misc/is-nullish/index.js +0 -10
  78. package/agnostic/misc/logs/index.d.ts +0 -55
  79. package/agnostic/misc/logs/index.js +0 -6
  80. package/agnostic/misc/random/index.d.ts +0 -10
  81. package/agnostic/misc/random/index.js +0 -6
  82. package/agnostic/misc/tennis/index.d.ts +0 -60
  83. package/agnostic/misc/tennis/index.js +0 -6
  84. package/agnostic/numbers/absolute-modulo/index.d.ts +0 -1
  85. package/agnostic/numbers/absolute-modulo/index.js +0 -6
  86. package/agnostic/numbers/clamp/index.d.ts +0 -1
  87. package/agnostic/numbers/clamp/index.js +0 -6
  88. package/agnostic/numbers/index.d.ts +0 -13
  89. package/agnostic/numbers/index.js +0 -30
  90. package/agnostic/numbers/interpolate/index.d.ts +0 -1
  91. package/agnostic/numbers/interpolate/index.js +0 -6
  92. package/agnostic/numbers/responsive-harmonics/index.d.ts +0 -10
  93. package/agnostic/numbers/responsive-harmonics/index.js +0 -9
  94. package/agnostic/numbers/round/index.d.ts +0 -1
  95. package/agnostic/numbers/round/index.js +0 -6
  96. package/agnostic/objects/enums/index.d.ts +0 -4
  97. package/agnostic/objects/enums/index.js +0 -7
  98. package/agnostic/objects/enums/is-in-enum/index.d.ts +0 -1
  99. package/agnostic/objects/enums/is-in-enum/index.js +0 -6
  100. package/agnostic/objects/flatten-getters/index.d.ts +0 -1
  101. package/agnostic/objects/flatten-getters/index.js +0 -9
  102. package/agnostic/objects/index.d.ts +0 -12
  103. package/agnostic/objects/index.js +0 -32
  104. package/agnostic/objects/is-object/index.d.ts +0 -1
  105. package/agnostic/objects/is-object/index.js +0 -6
  106. package/agnostic/objects/is-record/index.d.ts +0 -1
  107. package/agnostic/objects/is-record/index.js +0 -6
  108. package/agnostic/objects/record-format/index.d.ts +0 -11
  109. package/agnostic/objects/record-format/index.js +0 -16
  110. package/agnostic/objects/validation/index.d.ts +0 -3
  111. package/agnostic/objects/validation/index.js +0 -6
  112. package/agnostic/optim/index.d.ts +0 -7
  113. package/agnostic/optim/index.js +0 -18
  114. package/agnostic/optim/memoize/index.d.ts +0 -3
  115. package/agnostic/optim/memoize/index.js +0 -6
  116. package/agnostic/optim/throttle-debounce/index.d.ts +0 -30
  117. package/agnostic/optim/throttle-debounce/index.js +0 -8
  118. package/agnostic/optim/throttle-debounce/types.d.ts +0 -2
  119. package/agnostic/regexps/index.d.ts +0 -23
  120. package/agnostic/regexps/index.js +0 -89
  121. package/agnostic/strings/char-codes/index.d.ts +0 -17
  122. package/agnostic/strings/char-codes/index.js +0 -6
  123. package/agnostic/strings/index.d.ts +0 -14
  124. package/agnostic/strings/index.js +0 -32
  125. package/agnostic/strings/matches/index.d.ts +0 -3
  126. package/agnostic/strings/matches/index.js +0 -10
  127. package/agnostic/strings/normalize-indent/index.d.ts +0 -1
  128. package/agnostic/strings/normalize-indent/index.js +0 -6
  129. package/agnostic/strings/replace-all/index.d.ts +0 -1
  130. package/agnostic/strings/replace-all/index.js +0 -6
  131. package/agnostic/strings/to-alphanum/index.d.ts +0 -1
  132. package/agnostic/strings/to-alphanum/index.js +0 -6
  133. package/chunks/chunk-32IRF4OP.js +0 -9
  134. package/chunks/chunk-34U4HX4V.js +0 -73
  135. package/chunks/chunk-4GDNHUCZ.js +0 -162
  136. package/chunks/chunk-4QQBKBYH.js +0 -59
  137. package/chunks/chunk-4VC5PT5T.js +0 -13
  138. package/chunks/chunk-5LNUCDQ6.js +0 -132
  139. package/chunks/chunk-7AWTHZLY.js +0 -12
  140. package/chunks/chunk-7DBNMU6N.js +0 -14
  141. package/chunks/chunk-COVPTTAD.js +0 -10
  142. package/chunks/chunk-DNIOWD7K.js +0 -8
  143. package/chunks/chunk-DQNJQBC6.js +0 -10
  144. package/chunks/chunk-E6MSDKON.js +0 -13
  145. package/chunks/chunk-EDVNAV3G.js +0 -72
  146. package/chunks/chunk-EW46EXFB.js +0 -8
  147. package/chunks/chunk-FPEW3A27.js +0 -14
  148. package/chunks/chunk-GJOU3UAL.js +0 -36
  149. package/chunks/chunk-HC6ZOHCS.js +0 -14
  150. package/chunks/chunk-HGCG2J77.js +0 -122
  151. package/chunks/chunk-IFD7GSGK.js +0 -130
  152. package/chunks/chunk-JQXNEJAP.js +0 -18
  153. package/chunks/chunk-JWBDZPQG.js +0 -18
  154. package/chunks/chunk-K37RALUX.js +0 -8
  155. package/chunks/chunk-KIONYWA7.js +0 -168
  156. package/chunks/chunk-KQT5CTGF.js +0 -21
  157. package/chunks/chunk-LEXQ6E6L.js +0 -31
  158. package/chunks/chunk-LQFKUNVQ.js +0 -19
  159. package/chunks/chunk-MF56TTC5.js +0 -15
  160. package/chunks/chunk-MT74WIQR.js +0 -41
  161. package/chunks/chunk-NRITRUZW.js +0 -10
  162. package/chunks/chunk-NRJQKVQV.js +0 -31
  163. package/chunks/chunk-OSAXBA7G.js +0 -10
  164. package/chunks/chunk-PO3V3I57.js +0 -23
  165. package/chunks/chunk-QXAJXTXV.js +0 -19
  166. package/chunks/chunk-RCO57B6F.js +0 -9
  167. package/chunks/chunk-SQZGZ3VT.js +0 -15
  168. package/chunks/chunk-TTZHPIH7.js +0 -237
  169. package/chunks/chunk-UYTXXUU7.js +0 -54
  170. package/chunks/chunk-VTPRO4NJ.js +0 -10
  171. package/chunks/chunk-VYW4IADX.js +0 -35
  172. package/chunks/chunk-VZDUZTW6.js +0 -113
  173. package/chunks/chunk-W5A2TON3.js +0 -10
  174. package/chunks/chunk-W7YBGJ4H.js +0 -28
  175. package/chunks/chunk-WLL3FNVL.js +0 -40
  176. package/chunks/chunk-WOAYU6LB.js +0 -13
  177. package/chunks/chunk-XA4HVHJ4.js +0 -18
  178. package/chunks/chunk-XN3PZIVL.js +0 -38
  179. package/chunks/chunk-Y3OZHZUF.js +0 -237
  180. package/chunks/chunk-YDIBNEGA.js +0 -9
  181. package/chunks/chunk-ZC5RZBNY.js +0 -33
  182. package/components/index.d.ts +0 -1
  183. package/index.d.ts +0 -3
  184. package/node/files/index.d.ts +0 -9
  185. package/node/files/index.js +0 -21
  186. package/node/files/is-in-directory/index.d.ts +0 -1
  187. package/node/files/is-in-directory/index.js +0 -6
  188. package/node/files/read-write/index.d.ts +0 -9
  189. package/node/files/read-write/index.js +0 -6
  190. package/node/files/subpaths/index.d.ts +0 -34
  191. package/node/files/subpaths/index.js +0 -7
  192. package/node/image/index.d.ts +0 -9
  193. package/node/image/index.js +0 -74
  194. package/node/mxfb-cli-config/index.d.ts +0 -19
  195. package/node/mxfb-cli-config/index.js +0 -113
  196. package/node/process/index.d.ts +0 -8
  197. package/node/process/index.js +0 -20
  198. package/node/process/on-exit/index.d.ts +0 -5
  199. package/node/process/on-exit/index.js +0 -14
  200. package/shared/errors/index.d.ts +0 -138
  201. /package/{shared/index.d.ts → agnostic/scrapers/@meteociel/types.js} +0 -0
@@ -1,54 +0,0 @@
1
- import {
2
- round
3
- } from "./chunk-32IRF4OP.js";
4
-
5
- // src/agnostic/numbers/responsive-harmonics/index.ts
6
- function getHarmonic(min, max, level, steps) {
7
- if (min === 0) {
8
- console.warn("Cannot generate harmonics if min value is zero");
9
- return NaN;
10
- }
11
- if (steps < 1) {
12
- console.warn("Cannot generate harmonics if steps is lower than one");
13
- return NaN;
14
- }
15
- const maxOverMin = max / min;
16
- const oneOverSteps = 1 / parseInt(`${steps}`);
17
- const factor = Math.pow(maxOverMin, oneOverSteps);
18
- return min * Math.pow(factor, level);
19
- }
20
- function getAffineFunction(x1, y1, x2, y2) {
21
- const slope = (y2 - y1) / (x2 - x1);
22
- const yIntercept = y1 - x1 * slope;
23
- return { slope, yIntercept };
24
- }
25
- function getCssValueFromAffine(affine) {
26
- const { slope, yIntercept } = affine;
27
- const roundedSlope = round(100 * slope, 3);
28
- const roundedIntercept = round(yIntercept, 2);
29
- return `calc(${roundedSlope}vw + ${roundedIntercept}px)`;
30
- }
31
- function createScale(descriptor) {
32
- const {
33
- screenBounds: [loBound, hiBound],
34
- lowLevel: [loLevelMin, loLevelMax],
35
- highLevel: [hiLevelMin, hiLevelMax],
36
- steps,
37
- clamp
38
- } = descriptor;
39
- return function scale(level) {
40
- if (steps < 2) return;
41
- const loBoundVal = getHarmonic(loLevelMin, hiLevelMin, level - 1, steps - 1);
42
- const hiBoundVal = getHarmonic(loLevelMax, hiLevelMax, level - 1, steps - 1);
43
- if (loBoundVal === void 0) return;
44
- if (hiBoundVal === void 0) return;
45
- const affine = getAffineFunction(loBound, loBoundVal, hiBound, hiBoundVal);
46
- const cssFormula = getCssValueFromAffine(affine);
47
- return clamp === true ? `clamp(${round(loBoundVal, 2)}px, ${cssFormula}, ${round(hiBoundVal, 2)}px)` : cssFormula;
48
- };
49
- }
50
-
51
- export {
52
- getHarmonic,
53
- createScale
54
- };
@@ -1,10 +0,0 @@
1
- // src/agnostic/html/get-position-inside-parent/index.ts
2
- function getPositionInsideParent(node) {
3
- if (!node.parentNode) return null;
4
- const childNodes = Array.from(node.parentNode.childNodes);
5
- return childNodes.indexOf(node);
6
- }
7
-
8
- export {
9
- getPositionInsideParent
10
- };
@@ -1,35 +0,0 @@
1
- // src/agnostic/html/placeholders/index.ts
2
- var Placeholders;
3
- ((Placeholders2) => {
4
- Placeholders2.EightKiloByteOfLoremIpsumSentences = "Etiam consequat interdum elit eu interdum. Nunc eu nulla vel arcu mattis venenatis sit amet gravida sem. Mauris pretium aliquam augue vitae tempor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam mollis in ipsum nec efficitur. Nullam imperdiet et urna vitae suscipit. In hac habitasse platea dictumst. Nullam lacinia commodo enim non iaculis. Nam elementum tellus ac lectus aliquam porta. Mauris ut lorem nec magna porttitor efficitur sed sed odio. Ut in dapibus nulla, non eleifend elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas posuere leo neque, a luctus quam feugiat in. Phasellus lobortis egestas cursus. In sit amet massa et sem scelerisque facilisis quis fringilla felis. Praesent purus velit, vehicula id orci ac, placerat congue quam. Cras vulputate nisi eu justo accumsan malesuada. Vestibulum ex urna, volutpat non quam in, vulputate pellentesque est. Pellentesque interdum orci in quam finibus faucibus. In eget lectus augue. Vestibulum lobortis vulputate odio. Nam vitae felis in lorem dignissim venenatis. Curabitur bibendum, est quis tempor efficitur, magna orci facilisis erat, id rhoncus massa ante non tellus. Etiam id gravida elit. Mauris ut semper risus. Nulla sed interdum lorem. Nullam eu consectetur purus. Praesent ut enim diam. Nulla hendrerit dapibus eros, sit amet rhoncus eros consequat aliquam. Duis viverra erat vel commodo facilisis. Quisque hendrerit posuere sapien, id cursus ligula rhoncus vitae. Ut et turpis augue. Aliquam augue lorem, fringilla at magna eu, egestas sagittis ex. Vestibulum elementum diam facilisis elit ultrices, eget viverra massa venenatis. Nullam finibus ligula est. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam condimentum, justo pulvinar posuere tincidunt, mi libero convallis sapien, id consectetur nunc tellus eget nisi. Fusce tincidunt sit amet enim vitae feugiat. Etiam in nulla vitae orci consequat vulputate. Vestibulum sodales urna sit amet velit elementum, vel fringilla eros iaculis. Vestibulum gravida tempus nulla, at vulputate nunc aliquam vitae. Phasellus ac augue et augue finibus congue ut nec nunc. Ut in dictum lectus, eget efficitur dui. Suspendisse bibendum congue arcu, sit amet maximus felis dictum sit amet. Morbi scelerisque feugiat risus, id pellentesque elit cursus nec. Vivamus at erat id magna sagittis cursus vitae eu magna. Integer pretium nec lorem at consectetur. Integer id justo vitae nunc gravida posuere eu vel magna. Donec ex nunc, condimentum id laoreet et, scelerisque nec enim. Sed venenatis, augue vel posuere ullamcorper, lorem velit auctor erat, a auctor mi odio id velit. Donec justo erat, tempor ut diam sed, scelerisque aliquam dolor. Donec erat dui, dictum a tortor sit amet, pellentesque blandit risus. Donec tincidunt ligula ex, vel tincidunt leo posuere sit amet. Curabitur lacinia blandit pellentesque. Donec fringilla aliquam purus ac porta. Fusce faucibus convallis leo, ut aliquet libero maximus nec. Morbi ac magna lorem. Quisque suscipit quis nisi interdum condimentum. Pellentesque imperdiet lorem diam, eu molestie ipsum scelerisque vel. Vivamus hendrerit, ipsum id sollicitudin pharetra, justo justo laoreet lorem, ac scelerisque turpis justo vitae augue. Nullam lacinia magna nec neque auctor scelerisque. Nunc sit amet lacus condimentum, interdum nisl eu, pharetra lorem. Morbi consectetur eros ac nisi facilisis, facilisis placerat magna aliquet. Donec bibendum leo ac est aliquam dictum. Quisque commodo magna risus, ut rhoncus ex feugiat nec. Sed vel tellus porta, feugiat sem quis, facilisis enim. Quisque accumsan imperdiet felis id laoreet. Etiam condimentum at ligula nec vehicula. Phasellus eget placerat quam. Cras efficitur mauris id ex tempus porttitor. Quisque pulvinar tellus id tempus ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In non erat justo. Nulla blandit placerat hendrerit. Sed blandit mattis magna eget sodales. Morbi eget accumsan sapien. Sed ornare interdum tortor iaculis volutpat. Maecenas vel tortor quis urna placerat mollis. Mauris ultrices, magna sit amet molestie sagittis, libero mi tincidunt diam, eu scelerisque nulla est vel dolor. Aenean congue congue eros bibendum elementum. Phasellus lobortis faucibus eros, et cursus lectus ultricies et. Vivamus augue metus, iaculis eget egestas in, tincidunt et lectus. Mauris varius arcu at cursus auctor. Curabitur eget nunc tellus. In eget tempor odio, vitae dictum massa. Proin in cursus est. Curabitur lobortis, velit eu accumsan sollicitudin, orci orci aliquam velit, ac iaculis massa justo sit amet massa. Duis a mauris iaculis, aliquam ipsum vel, vulputate mauris. Sed ex augue, cursus a dapibus sed, iaculis lacinia quam. Vivamus sit amet justo tellus. Nunc ac neque mattis, euismod velit id, feugiat massa. Etiam vitae auctor orci. Pellentesque sollicitudin est nibh, vitae scelerisque lacus sagittis eu. Morbi convallis metus eu enim gravida, non finibus enim accumsan. In quis pharetra justo, et tempor nibh. Duis non interdum diam. Vestibulum nec felis rhoncus, pharetra ipsum eu, rutrum magna. Integer dignissim odio eu mi finibus sollicitudin. Sed ut magna a nulla porttitor lobortis in id nibh. Pellentesque in lobortis ligula, vel malesuada neque. Aenean commodo arcu nunc, et posuere eros vulputate et. Mauris vestibulum euismod molestie. Vestibulum luctus sapien sollicitudin, cursus ante vel, varius massa. Mauris non magna pharetra, luctus felis sed, dapibus massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec posuere sapien diam, vitae porttitor nisi dictum sed. Maecenas sit amet eleifend odio. In luctus, neque eget eleifend ultricies, neque ante vestibulum leo, non ullamcorper enim orci vestibulum erat. Phasellus bibendum urna at aliquet elementum. Nulla facilisi. Sed porttitor lacus id hendrerit iaculis. Vivamus facilisis ex eget odio malesuada bibendum. Vestibulum fermentum at sem nec dignissim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc faucibus augue id odio ornare, et maximus quam placerat. Nullam rutrum enim justo, id hendrerit felis faucibus sed. Aenean id nulla arcu. Nulla vitae eleifend ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ipsum risus, cursus at ligula convallis, interdum fringilla quam. Curabitur libero sapien, mollis in consectetur sit amet, accumsan vel justo. Nulla a eros sit amet nibh pharetra ultricies. Proin et dapibus mauris. Maecenas at lacinia felis. Vestibulum consectetur vestibulum ante. Interdum et malesuada fames ac ante ipsum primis in faucibus. In imperdiet ipsum ac facilisis interdum. Nullam vestibulum dictum vestibulum. Cras pharetra vehicula neque.".split(".").map((e) => e.trim());
5
- Placeholders2.generateSentence = () => {
6
- const pos = Math.floor(Math.random() * Placeholders2.EightKiloByteOfLoremIpsumSentences.length);
7
- return Placeholders2.EightKiloByteOfLoremIpsumSentences[pos];
8
- };
9
- Placeholders2.generateSentences = (amount = 1) => {
10
- return new Array(amount).fill(null).map(Placeholders2.generateSentence);
11
- };
12
- Placeholders2.generateTitle = () => `<h1 class="title">${(0, Placeholders2.generateSentence)()}</h1>`;
13
- Placeholders2.generateIntertitle = () => `<h2 class="intertitle">${(0, Placeholders2.generateSentence)()}</h2>`;
14
- Placeholders2.generateParagraph = () => {
15
- const length = Math.floor(Math.random() * 5) + 3;
16
- const sentencesArr = new Array(length).fill(null).map(Placeholders2.generateSentence);
17
- return `<p class="paragraph">${sentencesArr.join(". ")}</p>`;
18
- };
19
- Placeholders2.generateContentPage = (len = 1) => {
20
- const length = (Math.floor(Math.random() * 3) + 3) * Math.round(len);
21
- const pageBody = new Array(length).fill(null).map(() => {
22
- if (Math.random() < 0.2) return (0, Placeholders2.generateIntertitle)();
23
- return (0, Placeholders2.generateParagraph)();
24
- }).join("");
25
- return `<div class="content-page">
26
- ${(0, Placeholders2.generateTitle)()}
27
- ${pageBody}
28
- ${(0, Placeholders2.generateParagraph)()}
29
- </div>`;
30
- };
31
- })(Placeholders || (Placeholders = {}));
32
-
33
- export {
34
- Placeholders
35
- };
@@ -1,113 +0,0 @@
1
- // src/agnostic/optim/throttle-debounce/index.ts
2
- function throttle(toThrottleFunc, delayMs) {
3
- let currentDelayMs = delayMs;
4
- let lastArgs = [];
5
- let lastExecutedOn = 0;
6
- let lastReturnValue = void 0;
7
- let nextExecutionTimeout = null;
8
- function scheduleNextCall() {
9
- if (nextExecutionTimeout !== null) {
10
- clearTimeout(nextExecutionTimeout);
11
- nextExecutionTimeout = null;
12
- }
13
- const now = Date.now();
14
- const nextExecutionTimestamp = lastExecutedOn + currentDelayMs;
15
- const msTillNextExecution = nextExecutionTimestamp - now;
16
- nextExecutionTimeout = setTimeout(() => {
17
- nextExecutionTimeout = null;
18
- const returnValue = toThrottleFunc(...lastArgs);
19
- lastReturnValue = returnValue;
20
- lastExecutedOn = now;
21
- }, msTillNextExecution) ?? null;
22
- }
23
- function throttled(...args) {
24
- const now = Date.now();
25
- lastArgs = args;
26
- if (now - lastExecutedOn >= delayMs) {
27
- const returnValue = toThrottleFunc(...lastArgs);
28
- lastReturnValue = returnValue;
29
- lastExecutedOn = now;
30
- return {
31
- returnValue: lastReturnValue,
32
- lastExecutedOn,
33
- delayMs: currentDelayMs,
34
- isCached: false
35
- };
36
- }
37
- if (nextExecutionTimeout === null) scheduleNextCall();
38
- return {
39
- returnValue: lastReturnValue,
40
- lastExecutedOn,
41
- delayMs: currentDelayMs,
42
- isCached: true
43
- };
44
- }
45
- function setDelay(delayMs2) {
46
- currentDelayMs = delayMs2;
47
- if (nextExecutionTimeout !== null) scheduleNextCall();
48
- }
49
- return {
50
- throttled,
51
- setDelay
52
- };
53
- }
54
- function debounce(toDebounceFunc, delayMs) {
55
- let currentDelayMs = delayMs;
56
- let lastArgs = [];
57
- let lastCalledOn = 0;
58
- let lastExecutedOn = 0;
59
- let lastReturnValue = void 0;
60
- let nextExecutionTimeout = null;
61
- function scheduleNextCall() {
62
- if (typeof nextExecutionTimeout === "number") {
63
- clearTimeout(nextExecutionTimeout);
64
- nextExecutionTimeout = null;
65
- }
66
- const now = Date.now();
67
- const nextExecutionTimestamp = lastCalledOn + currentDelayMs;
68
- const msTillNextExecution = nextExecutionTimestamp - now;
69
- nextExecutionTimeout = setTimeout(() => {
70
- nextExecutionTimeout = null;
71
- const returnValue = toDebounceFunc(...lastArgs);
72
- lastReturnValue = returnValue;
73
- lastExecutedOn = now;
74
- }, msTillNextExecution) ?? null;
75
- }
76
- function debounced(...args) {
77
- const now = Date.now();
78
- lastArgs = args;
79
- if (now - lastCalledOn >= currentDelayMs) {
80
- lastCalledOn = now;
81
- const returnValue = toDebounceFunc(...lastArgs);
82
- lastReturnValue = returnValue;
83
- lastExecutedOn = now;
84
- return {
85
- returnValue: lastReturnValue,
86
- lastExecutedOn,
87
- delayMs: currentDelayMs,
88
- isCached: false
89
- };
90
- }
91
- lastCalledOn = now;
92
- scheduleNextCall();
93
- return {
94
- returnValue: lastReturnValue,
95
- lastExecutedOn,
96
- delayMs: currentDelayMs,
97
- isCached: true
98
- };
99
- }
100
- function setDelay(delayMs2) {
101
- currentDelayMs = delayMs2;
102
- if (nextExecutionTimeout !== null) scheduleNextCall();
103
- }
104
- return {
105
- debounced,
106
- setDelay
107
- };
108
- }
109
-
110
- export {
111
- throttle,
112
- debounce
113
- };
@@ -1,10 +0,0 @@
1
- // src/agnostic/css/is-valid-css-class-name/index.ts
2
- var classNameRegex = /^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/;
3
- function isValidClassName(string) {
4
- return classNameRegex.test(string);
5
- }
6
-
7
- export {
8
- classNameRegex,
9
- isValidClassName
10
- };
@@ -1,28 +0,0 @@
1
- // src/agnostic/misc/assert/index.ts
2
- var Assert;
3
- ((Assert2) => {
4
- function makeSuccess(label) {
5
- console.info(`\u2705 SUCCESS: "${label}"`);
6
- }
7
- function makeFailure(label) {
8
- throw new Error(`\u{1F6AB} FAILURE: "${label}""`);
9
- }
10
- function assert(label, assertion) {
11
- if (Array.isArray(assertion)) assertion.forEach((innerAssertion, pos) => assert(`${label} (${pos})`, innerAssertion));
12
- else if (typeof assertion === "function") {
13
- try {
14
- const result = assertion();
15
- if (result === false) makeFailure(label);
16
- else makeSuccess(label);
17
- } catch (err) {
18
- makeFailure(`${err}`);
19
- }
20
- } else if (assertion === false) makeFailure(label);
21
- else makeSuccess(label);
22
- }
23
- Assert2.assert = assert;
24
- })(Assert || (Assert = {}));
25
-
26
- export {
27
- Assert
28
- };
@@ -1,40 +0,0 @@
1
- // src/agnostic/misc/random/index.ts
2
- var Random;
3
- ((Random2) => {
4
- function random(bound1 = 1, bound2) {
5
- const min = bound2 === void 0 ? 0 : bound1;
6
- const max = bound2 === void 0 ? bound1 : bound2;
7
- if (min === max || min > max) return void 0;
8
- const range = max - min;
9
- return Math.random() * range + min;
10
- }
11
- Random2.random = random;
12
- function randomInt(...args) {
13
- const rand = random(...args);
14
- return rand !== void 0 ? Math.floor(rand) : void 0;
15
- }
16
- Random2.randomInt = randomInt;
17
- Random2.hexChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
18
- function randomHexChar() {
19
- const nbr = Math.floor(Math.random() * 16);
20
- const char = Random2.hexChars[nbr];
21
- return char;
22
- }
23
- Random2.randomHexChar = randomHexChar;
24
- function randomHash(length = 4) {
25
- return new Array(length).fill(null).map(randomHexChar).join("");
26
- }
27
- Random2.randomHash = randomHash;
28
- function randomHashPattern(pattern, joiner = "-") {
29
- return pattern.map(randomHash).join(joiner);
30
- }
31
- Random2.randomHashPattern = randomHashPattern;
32
- function randomUUID() {
33
- return randomHashPattern([8, 4, 4, 4, 12]);
34
- }
35
- Random2.randomUUID = randomUUID;
36
- })(Random || (Random = {}));
37
-
38
- export {
39
- Random
40
- };
@@ -1,13 +0,0 @@
1
- import {
2
- isInEnum
3
- } from "./chunk-E6MSDKON.js";
4
-
5
- // src/agnostic/objects/enums/index.ts
6
- var Enums;
7
- ((Enums2) => {
8
- Enums2.isInEnum = isInEnum;
9
- })(Enums || (Enums = {}));
10
-
11
- export {
12
- Enums
13
- };
@@ -1,18 +0,0 @@
1
- // src/agnostic/html/insert-node/index.ts
2
- function insertNode(node, position, reference) {
3
- if (position === "after") {
4
- if (reference.nextSibling !== null) reference.parentNode?.insertBefore(node, reference.nextSibling);
5
- else reference.parentNode?.appendChild(node);
6
- } else if (position === "before") {
7
- reference.parentNode?.insertBefore(node, reference);
8
- } else if (position === "startof") {
9
- if (reference.firstChild !== null) reference.insertBefore(node, reference.firstChild);
10
- else reference.appendChild(node);
11
- } else {
12
- reference.appendChild(node);
13
- }
14
- }
15
-
16
- export {
17
- insertNode
18
- };
@@ -1,38 +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/selector-to-element/index.ts
9
- function selectorToElement(selector, documentObj) {
10
- const actualDocument = documentObj ?? Crossenv.getDocument();
11
- if (actualDocument === null) throw register.getError("no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */, "The optional second parameter expects a Document object");
12
- const tagRegexp = /^[A-Za-z]+/;
13
- const idRegexp = /#[A-Za-z]+[\w\-\:]*/;
14
- const classRegexp = /\.[A-Za-z]+[\w\-]*/;
15
- const attributeRegexp = /\[[A-Za-z]+[\w\-]*(="[\w\-]+")?\]/;
16
- const matchedTags = selector.match(tagRegexp) ?? [];
17
- const matchedIds = selector.match(idRegexp) ?? [];
18
- const matchedClasses = selector.match(classRegexp) ?? [];
19
- const matchedAttrs = selector.match(attributeRegexp) ?? [];
20
- const tag = matchedTags[matchedTags.length - 1] ?? "div";
21
- const id = matchedIds[matchedIds.length - 1] ?? null;
22
- const classes = matchedClasses.map((matchedClass) => matchedClass.replace(/^\./, ""));
23
- const attributes = matchedAttrs.map((matchedAttr) => matchedAttr.replace(/^\[/, "").replace(/\]$/, "").split("="));
24
- const element = actualDocument.createElement(tag);
25
- if (id !== null) {
26
- element.id = id;
27
- }
28
- element.classList.add(...classes);
29
- attributes.forEach(([name, value = ""]) => {
30
- if (name === void 0) return;
31
- element.setAttribute(name, value);
32
- });
33
- return element;
34
- }
35
-
36
- export {
37
- selectorToElement
38
- };
@@ -1,237 +0,0 @@
1
- // src/agnostic/misc/tennis/index.ts
2
- var Tennis;
3
- ((Tennis2) => {
4
- let Score;
5
- ((Score2) => {
6
- class Game {
7
- format;
8
- pointsSequence = [];
9
- constructor(format) {
10
- this.format = format;
11
- }
12
- add(point) {
13
- if (!this.isFinished()) this.pointsSequence.push(point);
14
- return this;
15
- }
16
- getNumericScore() {
17
- const { pointsSequence, format } = this;
18
- const { upTo, diffToWin } = format;
19
- return pointsSequence.reduce((reduced, point) => {
20
- const [aScore, bScore] = reduced;
21
- const aWon = aScore >= upTo && aScore - bScore >= diffToWin;
22
- const bWon = bScore >= upTo && bScore - aScore >= diffToWin;
23
- if (aWon || bWon) return reduced;
24
- return point ? [aScore + 1, bScore] : [aScore, bScore + 1];
25
- }, [0, 0]);
26
- }
27
- static numericToStringScoreValue(numScore) {
28
- const [aScore, bScore] = numScore;
29
- if (aScore >= 3 && bScore >= 3) {
30
- if (aScore === bScore) return "deuce";
31
- if (aScore < bScore) return "Ad/40";
32
- return "40/Ad";
33
- }
34
- const strScoresList = ["0", "15", "30", "40"];
35
- return `${strScoresList.at(aScore) ?? "?"}/${strScoresList.at(bScore) ?? "?"}`;
36
- }
37
- getScore() {
38
- return Game.numericToStringScoreValue(this.getNumericScore());
39
- }
40
- isFinished() {
41
- const { format } = this;
42
- const { upTo, diffToWin } = format;
43
- const [aScore, bScore] = this.getNumericScore();
44
- const maxScoreReached = Math.max(aScore, bScore) >= upTo;
45
- const diffReached = Math.abs(aScore - bScore) >= diffToWin;
46
- if (maxScoreReached && diffReached) return true;
47
- return false;
48
- }
49
- getWinner() {
50
- if (!this.isFinished()) return null;
51
- const [aScore, bScore] = this.getNumericScore();
52
- return aScore > bScore;
53
- }
54
- }
55
- Score2.Game = Game;
56
- class Set {
57
- format;
58
- pointsSequence = [];
59
- constructor(format) {
60
- this.format = format;
61
- }
62
- add(point) {
63
- this.pointsSequence.push(point);
64
- }
65
- getGames() {
66
- const { format } = this;
67
- const { upTo, diffToWin, gamesFormat, tieBreakFormat, tieBreakAt } = format;
68
- let aGames = 0;
69
- let bGames = 0;
70
- const games = [];
71
- const { pointsSequence } = this;
72
- pointsSequence.forEach((point) => {
73
- const maxGamesReached = Math.max(aGames, bGames) >= upTo;
74
- const diffReached = Math.abs(aGames - bGames) >= diffToWin;
75
- if (maxGamesReached && diffReached) return;
76
- const lastGameInList = games.at(-1);
77
- const lastGameIsFinished = lastGameInList?.isFinished();
78
- if (lastGameInList === void 0 || lastGameIsFinished === true) {
79
- const isTiebreak = aGames === bGames && aGames === tieBreakAt;
80
- if (isTiebreak) games.push(new Game(tieBreakFormat));
81
- else games.push(new Game(gamesFormat));
82
- }
83
- const currentGame = games.at(-1);
84
- if (currentGame === void 0) throw "Something went wrong, this should't be undefined";
85
- currentGame.add(point);
86
- const currentGameWinner = currentGame.getWinner();
87
- if (currentGameWinner === true) {
88
- aGames += 1;
89
- }
90
- if (currentGameWinner === false) {
91
- bGames += 1;
92
- }
93
- });
94
- return games;
95
- }
96
- getNumericScore() {
97
- const games = this.getGames();
98
- let aScore = 0;
99
- let bScore = 0;
100
- games.forEach((game) => {
101
- const winner = game.getWinner();
102
- if (winner === true) {
103
- aScore++;
104
- }
105
- if (winner === false) {
106
- bScore++;
107
- }
108
- });
109
- const lastGame = games.at(-1);
110
- if (lastGame === void 0) return { games: [aScore, bScore] };
111
- if (lastGame.isFinished() === false) return {
112
- games: [aScore, bScore],
113
- currentGame: lastGame.getNumericScore()
114
- };
115
- return { games: [aScore, bScore] };
116
- }
117
- getScore() {
118
- const numericScore = this.getNumericScore();
119
- const { games, currentGame } = numericScore;
120
- if (currentGame === void 0) return `${games.join("/")}`;
121
- return `${games.join("/")} ${Game.numericToStringScoreValue(currentGame)}`;
122
- }
123
- isFinished() {
124
- const { format } = this;
125
- const { upTo, diffToWin, tieBreakAt } = format;
126
- const [aScore, bScore] = this.getNumericScore().games;
127
- const maxGamesReached = Math.max(aScore, bScore) >= upTo;
128
- const diffReached = Math.abs(aScore - bScore) >= diffToWin;
129
- const tieBreakBeenPlayed = tieBreakAt !== null && Math.max(aScore, bScore) > tieBreakAt;
130
- return tieBreakBeenPlayed || maxGamesReached && diffReached;
131
- }
132
- getWinner() {
133
- if (!this.isFinished()) return null;
134
- const [aScore, bScore] = this.getNumericScore().games;
135
- return aScore > bScore;
136
- }
137
- }
138
- Score2.Set = Set;
139
- class Match {
140
- format;
141
- pointsSequence = [];
142
- constructor(format) {
143
- this.format = format;
144
- }
145
- add(point) {
146
- this.pointsSequence.push(point);
147
- }
148
- getSets() {
149
- const { format } = this;
150
- const { upTo, setsFormat, lastSetFormat } = format;
151
- let aSets = 0;
152
- let bSets = 0;
153
- const sets = [];
154
- const { pointsSequence } = this;
155
- pointsSequence.forEach((point) => {
156
- const maxSetsReached = Math.max(aSets, bSets) >= upTo;
157
- if (maxSetsReached) return;
158
- const lastSetInList = sets.at(-1);
159
- const lastSetIsFinished = lastSetInList?.isFinished();
160
- if (lastSetInList === void 0 || lastSetIsFinished === true) {
161
- const isTiebreak = aSets === bSets && aSets === upTo;
162
- if (isTiebreak) sets.push(new Set(lastSetFormat));
163
- else sets.push(new Set(setsFormat));
164
- }
165
- const currentSet = sets.at(-1);
166
- if (currentSet === void 0) throw "Something went wrong, this should't be undefined";
167
- currentSet.add(point);
168
- const currentSetWinner = currentSet.getWinner();
169
- if (currentSetWinner === true) {
170
- aSets += 1;
171
- }
172
- if (currentSetWinner === false) {
173
- bSets += 1;
174
- }
175
- });
176
- return sets;
177
- }
178
- getNumericScore() {
179
- const sets = this.getSets();
180
- const numericScore = {
181
- sets: [],
182
- currentGame: void 0
183
- };
184
- sets.forEach((set) => {
185
- const setNumericScore = set.getNumericScore();
186
- const { games, currentGame } = setNumericScore;
187
- numericScore.sets.push(games);
188
- if (currentGame !== void 0) {
189
- numericScore.currentGame = currentGame;
190
- }
191
- });
192
- return numericScore;
193
- }
194
- getScore() {
195
- return this.getSets().map((set) => set.getScore()).join(" ");
196
- }
197
- isFinished() {
198
- const { format } = this;
199
- const { upTo } = format;
200
- const sets = this.getSets();
201
- let aSets = 0;
202
- let bSets = 0;
203
- sets.forEach((set) => {
204
- const winner = set.getWinner();
205
- if (winner === true) {
206
- aSets++;
207
- }
208
- if (winner === false) {
209
- bSets++;
210
- }
211
- });
212
- return Math.max(aSets, bSets) >= upTo;
213
- }
214
- getWinner() {
215
- if (!this.isFinished()) return null;
216
- const sets = this.getSets();
217
- let aSets = 0;
218
- let bSets = 0;
219
- sets.forEach((set) => {
220
- const winner = set.getWinner();
221
- if (winner === true) {
222
- aSets++;
223
- }
224
- if (winner === false) {
225
- bSets++;
226
- }
227
- });
228
- return aSets > bSets;
229
- }
230
- }
231
- Score2.Match = Match;
232
- })(Score = Tennis2.Score || (Tennis2.Score = {}));
233
- })(Tennis || (Tennis = {}));
234
-
235
- export {
236
- Tennis
237
- };
@@ -1,9 +0,0 @@
1
- // src/agnostic/objects/is-record/index.ts
2
- function isRecord(input) {
3
- if (typeof input !== "object" || input === null) return false;
4
- return Object.keys(input).every((key) => typeof key === "string");
5
- }
6
-
7
- export {
8
- isRecord
9
- };
@@ -1,33 +0,0 @@
1
- // src/agnostic/misc/elo/index.ts
2
- var Elo;
3
- ((Elo2) => {
4
- Elo2.K_FACTOR = 32;
5
- function getWinProbability(eloA, eloB) {
6
- const exponent = (eloB - eloA) / 400;
7
- return 1 / (1 + Math.pow(10, exponent));
8
- }
9
- Elo2.getWinProbability = getWinProbability;
10
- function getOutcome(eloA, eloB, kFactor = Elo2.K_FACTOR) {
11
- const probA = getWinProbability(eloA, eloB);
12
- const probB = 1 - probA;
13
- return {
14
- aWins: {
15
- eloA: Math.round(eloA + kFactor * (1 - probA)),
16
- eloB: Math.round(eloB + kFactor * (0 - probB))
17
- },
18
- bWins: {
19
- eloA: Math.round(eloA + kFactor * (0 - probA)),
20
- eloB: Math.round(eloB + kFactor * (1 - probB))
21
- },
22
- null: {
23
- eloA: Math.round(eloA + kFactor * (0.5 - probA)),
24
- eloB: Math.round(eloB + kFactor * (0.5 - probB))
25
- }
26
- };
27
- }
28
- Elo2.getOutcome = getOutcome;
29
- })(Elo || (Elo = {}));
30
-
31
- export {
32
- Elo
33
- };
@@ -1 +0,0 @@
1
- export declare namespace Components { }
package/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { Agnostic } from './agnostic';
2
- export { Components } from './components';
3
- export { Node } from './node';
@@ -1,9 +0,0 @@
1
- import { isInDirectory as isInDirectoryFunc } from './is-in-directory';
2
- import { ReadWriteEditorFunc as ReadWriteEditorFuncType, readWrite as readWriteFunc } from './read-write';
3
- import { Subpaths as SubpathsNamespace } from './subpaths';
4
- export declare namespace Files {
5
- const isInDirectory: typeof isInDirectoryFunc;
6
- type ReadWriteEditorFunc = ReadWriteEditorFuncType;
7
- const readWrite: typeof readWriteFunc;
8
- export import Subpaths = SubpathsNamespace;
9
- }