@wexample/js-helpers 0.0.3 → 0.0.7

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 (107) hide show
  1. package/README.md +5 -3
  2. package/dist/Common/AsyncConstructor.cjs +49 -0
  3. package/dist/Common/AsyncConstructor.cjs.map +1 -0
  4. package/dist/Common/AsyncConstructor.d.cts +13 -0
  5. package/dist/Common/AsyncConstructor.d.ts +13 -0
  6. package/dist/Common/AsyncConstructor.js +47 -0
  7. package/dist/Common/AsyncConstructor.js.map +1 -0
  8. package/dist/Helper/Array.cjs +33 -0
  9. package/dist/Helper/Array.cjs.map +1 -0
  10. package/dist/Helper/Array.d.cts +11 -0
  11. package/dist/Helper/Array.d.ts +11 -0
  12. package/dist/Helper/Array.js +26 -0
  13. package/dist/Helper/Array.js.map +1 -0
  14. package/dist/Helper/Bytes.cjs +17 -0
  15. package/dist/Helper/Bytes.cjs.map +1 -0
  16. package/dist/Helper/Bytes.d.cts +3 -0
  17. package/dist/Helper/Bytes.d.ts +3 -0
  18. package/dist/Helper/Bytes.js +15 -0
  19. package/dist/Helper/Bytes.js.map +1 -0
  20. package/dist/Helper/Dom.cjs +83 -0
  21. package/dist/Helper/Dom.cjs.map +1 -0
  22. package/dist/Helper/Dom.d.cts +32 -0
  23. package/dist/Helper/Dom.d.ts +32 -0
  24. package/dist/Helper/Dom.js +71 -0
  25. package/dist/Helper/Dom.js.map +1 -0
  26. package/dist/Helper/Event.cjs +35 -0
  27. package/dist/Helper/Event.cjs.map +1 -0
  28. package/dist/Helper/Event.d.cts +31 -0
  29. package/dist/Helper/Event.d.ts +31 -0
  30. package/dist/Helper/Event.js +33 -0
  31. package/dist/Helper/Event.js.map +1 -0
  32. package/dist/Helper/Function.cjs +10 -0
  33. package/dist/Helper/Function.cjs.map +1 -0
  34. package/dist/Helper/Function.d.cts +3 -0
  35. package/dist/Helper/Function.d.ts +3 -0
  36. package/dist/Helper/Function.js +8 -0
  37. package/dist/Helper/Function.js.map +1 -0
  38. package/dist/Helper/KeyCode.cjs +10 -0
  39. package/dist/Helper/KeyCode.cjs.map +1 -0
  40. package/dist/Helper/KeyCode.d.cts +6 -0
  41. package/dist/Helper/KeyCode.d.ts +6 -0
  42. package/dist/Helper/KeyCode.js +8 -0
  43. package/dist/Helper/KeyCode.js.map +1 -0
  44. package/dist/Helper/Location.cjs +57 -0
  45. package/dist/Helper/Location.cjs.map +1 -0
  46. package/dist/Helper/Location.d.cts +9 -0
  47. package/dist/Helper/Location.d.ts +9 -0
  48. package/dist/Helper/Location.js +51 -0
  49. package/dist/Helper/Location.js.map +1 -0
  50. package/dist/Helper/Log.cjs +37 -0
  51. package/dist/Helper/Log.cjs.map +1 -0
  52. package/dist/Helper/Log.d.cts +19 -0
  53. package/dist/Helper/Log.d.ts +19 -0
  54. package/dist/Helper/Log.js +31 -0
  55. package/dist/Helper/Log.js.map +1 -0
  56. package/dist/Helper/Mixin.cjs +29 -0
  57. package/dist/Helper/Mixin.cjs.map +1 -0
  58. package/dist/Helper/Mixin.d.cts +8 -0
  59. package/dist/Helper/Mixin.d.ts +8 -0
  60. package/dist/Helper/Mixin.js +27 -0
  61. package/dist/Helper/Mixin.js.map +1 -0
  62. package/dist/Helper/Object.cjs +103 -0
  63. package/dist/Helper/Object.cjs.map +1 -0
  64. package/dist/Helper/Object.d.cts +14 -0
  65. package/dist/Helper/Object.d.ts +14 -0
  66. package/dist/Helper/Object.js +95 -0
  67. package/dist/Helper/Object.js.map +1 -0
  68. package/dist/Helper/Pointer.cjs +10 -0
  69. package/dist/Helper/Pointer.cjs.map +1 -0
  70. package/dist/Helper/Pointer.d.cts +5 -0
  71. package/dist/Helper/Pointer.d.ts +5 -0
  72. package/dist/Helper/Pointer.js +8 -0
  73. package/dist/Helper/Pointer.js.map +1 -0
  74. package/dist/Helper/String.cjs +253 -0
  75. package/dist/Helper/String.cjs.map +1 -0
  76. package/dist/Helper/String.d.cts +50 -0
  77. package/dist/Helper/String.d.ts +50 -0
  78. package/dist/Helper/String.js +211 -0
  79. package/dist/Helper/String.js.map +1 -0
  80. package/dist/Helper/Time.cjs +12 -0
  81. package/dist/Helper/Time.cjs.map +1 -0
  82. package/dist/Helper/Time.d.cts +3 -0
  83. package/dist/Helper/Time.d.ts +3 -0
  84. package/dist/Helper/Time.js +10 -0
  85. package/dist/Helper/Time.js.map +1 -0
  86. package/dist/Helper/Url.cjs +24 -0
  87. package/dist/Helper/Url.cjs.map +1 -0
  88. package/dist/Helper/Url.d.cts +4 -0
  89. package/dist/Helper/Url.d.ts +4 -0
  90. package/dist/Helper/Url.js +21 -0
  91. package/dist/Helper/Url.js.map +1 -0
  92. package/dist/Helper/Variables.cjs +20 -0
  93. package/dist/Helper/Variables.cjs.map +1 -0
  94. package/dist/Helper/Variables.d.cts +12 -0
  95. package/dist/Helper/Variables.d.ts +12 -0
  96. package/dist/Helper/Variables.js +15 -0
  97. package/dist/Helper/Variables.js.map +1 -0
  98. package/package.json +36 -2
  99. package/.iml +0 -7
  100. package/.wex/config.yml +0 -3
  101. package/.wex/python/app_manager/.python-version +0 -1
  102. package/.wex/python/app_manager/__main__.py +0 -34
  103. package/.wex/python/app_manager/app_workdir.py +0 -37
  104. package/.wex/python/app_manager/pyproject.toml +0 -13
  105. package/.wex/python/app_manager/requirements.txt +0 -223
  106. package/src/helper/Array.ts +0 -7
  107. package/version.txt +0 -1
@@ -0,0 +1,31 @@
1
+ declare const EVENT: {
2
+ readonly CLICK: "click";
3
+ readonly DBLCLICK: "dblclick";
4
+ readonly CONTEXTMENU: "contextmenu";
5
+ readonly KEYDOWN: "keydown";
6
+ readonly KEYUP: "keyup";
7
+ readonly KEYPRESS: "keypress";
8
+ readonly INPUT: "input";
9
+ readonly CHANGE: "change";
10
+ readonly FOCUS: "focus";
11
+ readonly BLUR: "blur";
12
+ readonly SUBMIT: "submit";
13
+ readonly RESET: "reset";
14
+ readonly MOUSEUP: "mouseup";
15
+ readonly MOUSEDOWN: "mousedown";
16
+ readonly MOUSEMOVE: "mousemove";
17
+ readonly MOUSEENTER: "mouseenter";
18
+ readonly MOUSELEAVE: "mouseleave";
19
+ readonly WHEEL: "wheel";
20
+ readonly SCROLL: "scroll";
21
+ readonly RESIZE: "resize";
22
+ readonly TOUCHSTART: "touchstart";
23
+ readonly TOUCHMOVE: "touchmove";
24
+ readonly TOUCHEND: "touchend";
25
+ readonly POINTERDOWN: "pointerdown";
26
+ readonly POINTERMOVE: "pointermove";
27
+ readonly POINTERUP: "pointerup";
28
+ };
29
+ type EventName = (typeof EVENT)[keyof typeof EVENT];
30
+
31
+ export { EVENT, type EventName };
@@ -0,0 +1,33 @@
1
+ // src/Helper/Event.ts
2
+ var EVENT = {
3
+ CLICK: "click",
4
+ DBLCLICK: "dblclick",
5
+ CONTEXTMENU: "contextmenu",
6
+ KEYDOWN: "keydown",
7
+ KEYUP: "keyup",
8
+ KEYPRESS: "keypress",
9
+ INPUT: "input",
10
+ CHANGE: "change",
11
+ FOCUS: "focus",
12
+ BLUR: "blur",
13
+ SUBMIT: "submit",
14
+ RESET: "reset",
15
+ MOUSEUP: "mouseup",
16
+ MOUSEDOWN: "mousedown",
17
+ MOUSEMOVE: "mousemove",
18
+ MOUSEENTER: "mouseenter",
19
+ MOUSELEAVE: "mouseleave",
20
+ WHEEL: "wheel",
21
+ SCROLL: "scroll",
22
+ RESIZE: "resize",
23
+ TOUCHSTART: "touchstart",
24
+ TOUCHMOVE: "touchmove",
25
+ TOUCHEND: "touchend",
26
+ POINTERDOWN: "pointerdown",
27
+ POINTERMOVE: "pointermove",
28
+ POINTERUP: "pointerup"
29
+ };
30
+
31
+ export { EVENT };
32
+ //# sourceMappingURL=Event.js.map
33
+ //# sourceMappingURL=Event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Event.ts"],"names":[],"mappings":";AAAO,IAAM,KAAA,GAAQ;AAAA,EACnB,KAAA,EAAO,OAAA;AAAA,EACP,QAAA,EAAU,UAAA;AAAA,EACV,WAAA,EAAa,aAAA;AAAA,EACb,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO,OAAA;AAAA,EACP,QAAA,EAAU,UAAA;AAAA,EACV,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,SAAA,EAAW,WAAA;AAAA,EACX,SAAA,EAAW,WAAA;AAAA,EACX,UAAA,EAAY,YAAA;AAAA,EACZ,UAAA,EAAY,YAAA;AAAA,EACZ,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,UAAA,EAAY,YAAA;AAAA,EACZ,SAAA,EAAW,WAAA;AAAA,EACX,QAAA,EAAU,UAAA;AAAA,EACV,WAAA,EAAa,aAAA;AAAA,EACb,WAAA,EAAa,aAAA;AAAA,EACb,SAAA,EAAW;AACb","file":"Event.js","sourcesContent":["export const EVENT = {\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n CONTEXTMENU: 'contextmenu',\n KEYDOWN: 'keydown',\n KEYUP: 'keyup',\n KEYPRESS: 'keypress',\n INPUT: 'input',\n CHANGE: 'change',\n FOCUS: 'focus',\n BLUR: 'blur',\n SUBMIT: 'submit',\n RESET: 'reset',\n MOUSEUP: 'mouseup',\n MOUSEDOWN: 'mousedown',\n MOUSEMOVE: 'mousemove',\n MOUSEENTER: 'mouseenter',\n MOUSELEAVE: 'mouseleave',\n WHEEL: 'wheel',\n SCROLL: 'scroll',\n RESIZE: 'resize',\n TOUCHSTART: 'touchstart',\n TOUCHMOVE: 'touchmove',\n TOUCHEND: 'touchend',\n POINTERDOWN: 'pointerdown',\n POINTERMOVE: 'pointermove',\n POINTERUP: 'pointerup',\n} as const;\n\nexport type EventName = (typeof EVENT)[keyof typeof EVENT];\n"]}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/Function.ts
4
+ function functionIsType(value) {
5
+ return typeof value === "function";
6
+ }
7
+
8
+ exports.functionIsType = functionIsType;
9
+ //# sourceMappingURL=Function.cjs.map
10
+ //# sourceMappingURL=Function.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Function.ts"],"names":[],"mappings":";;;AAAO,SAAS,eACd,KAAA,EACgC;AAChC,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA;AAC1B","file":"Function.cjs","sourcesContent":["export function functionIsType<TArgs extends unknown[] = unknown[], R = unknown>(\n value: unknown\n): value is (...args: TArgs) => R {\n return typeof value === 'function';\n}\n"]}
@@ -0,0 +1,3 @@
1
+ declare function functionIsType<TArgs extends unknown[] = unknown[], R = unknown>(value: unknown): value is (...args: TArgs) => R;
2
+
3
+ export { functionIsType };
@@ -0,0 +1,3 @@
1
+ declare function functionIsType<TArgs extends unknown[] = unknown[], R = unknown>(value: unknown): value is (...args: TArgs) => R;
2
+
3
+ export { functionIsType };
@@ -0,0 +1,8 @@
1
+ // src/Helper/Function.ts
2
+ function functionIsType(value) {
3
+ return typeof value === "function";
4
+ }
5
+
6
+ export { functionIsType };
7
+ //# sourceMappingURL=Function.js.map
8
+ //# sourceMappingURL=Function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Function.ts"],"names":[],"mappings":";AAAO,SAAS,eACd,KAAA,EACgC;AAChC,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA;AAC1B","file":"Function.js","sourcesContent":["export function functionIsType<TArgs extends unknown[] = unknown[], R = unknown>(\n value: unknown\n): value is (...args: TArgs) => R {\n return typeof value === 'function';\n}\n"]}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/KeyCode.ts
4
+ var KEY_CODE = {
5
+ ESCAPE: "Escape"
6
+ };
7
+
8
+ exports.KEY_CODE = KEY_CODE;
9
+ //# sourceMappingURL=KeyCode.cjs.map
10
+ //# sourceMappingURL=KeyCode.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/KeyCode.ts"],"names":[],"mappings":";;;AAAO,IAAM,QAAA,GAAW;AAAA,EACtB,MAAA,EAAQ;AACV","file":"KeyCode.cjs","sourcesContent":["export const KEY_CODE = {\n ESCAPE: 'Escape',\n} as const;\n\nexport type KeyCode = (typeof KEY_CODE)[keyof typeof KEY_CODE];\n"]}
@@ -0,0 +1,6 @@
1
+ declare const KEY_CODE: {
2
+ readonly ESCAPE: "Escape";
3
+ };
4
+ type KeyCode = (typeof KEY_CODE)[keyof typeof KEY_CODE];
5
+
6
+ export { KEY_CODE, type KeyCode };
@@ -0,0 +1,6 @@
1
+ declare const KEY_CODE: {
2
+ readonly ESCAPE: "Escape";
3
+ };
4
+ type KeyCode = (typeof KEY_CODE)[keyof typeof KEY_CODE];
5
+
6
+ export { KEY_CODE, type KeyCode };
@@ -0,0 +1,8 @@
1
+ // src/Helper/KeyCode.ts
2
+ var KEY_CODE = {
3
+ ESCAPE: "Escape"
4
+ };
5
+
6
+ export { KEY_CODE };
7
+ //# sourceMappingURL=KeyCode.js.map
8
+ //# sourceMappingURL=KeyCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/KeyCode.ts"],"names":[],"mappings":";AAAO,IAAM,QAAA,GAAW;AAAA,EACtB,MAAA,EAAQ;AACV","file":"KeyCode.js","sourcesContent":["export const KEY_CODE = {\n ESCAPE: 'Escape',\n} as const;\n\nexport type KeyCode = (typeof KEY_CODE)[keyof typeof KEY_CODE];\n"]}
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/Location.ts
4
+ var locationParamsHash = null;
5
+ function locationParamReload() {
6
+ locationParamsHash = new URLSearchParams(window.location.hash.slice(1));
7
+ return locationParamsHash;
8
+ }
9
+ function locationHashParamGet(name, defaultValue = "") {
10
+ const params = locationParamReload();
11
+ const value = params.get(name);
12
+ return value !== null ? value : defaultValue;
13
+ }
14
+ function locationHashParamSet(name, value, ignoreHistory = false) {
15
+ const params = locationParamReload();
16
+ params.set(name, value);
17
+ const { pathname, search } = window.location;
18
+ locationUpdate(`${pathname}${search}#${params.toString()}`, ignoreHistory);
19
+ }
20
+ function locationUpdate(href, ignoreHistory = false) {
21
+ let nextHref = href;
22
+ if (nextHref.endsWith("#")) {
23
+ nextHref = nextHref.slice(0, -1);
24
+ }
25
+ const method = ignoreHistory ? "replaceState" : "pushState";
26
+ window.history[method]({ manualState: true }, document.title, nextHref);
27
+ }
28
+ function locationDetectLanguageAndRedirect(config) {
29
+ const userLanguage = (navigator.language || navigator?.userLanguage || "").toLowerCase();
30
+ const currentPath = window.location.pathname;
31
+ const redirectUrls = Object.values(config);
32
+ const escaped = redirectUrls.map((url) => url.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
33
+ const redirectPattern = new RegExp(`^(${escaped.join("|")})`);
34
+ if (redirectPattern.test(currentPath)) {
35
+ return;
36
+ }
37
+ let redirectUrl = config._default;
38
+ for (const [lang, url] of Object.entries(config)) {
39
+ if (lang === "_default") {
40
+ continue;
41
+ }
42
+ if (userLanguage.startsWith(lang.toLowerCase())) {
43
+ redirectUrl = url;
44
+ break;
45
+ }
46
+ }
47
+ const restOfPath = currentPath.replace(/^\//, "");
48
+ window.location.href = `${redirectUrl}${restOfPath}`;
49
+ }
50
+
51
+ exports.locationDetectLanguageAndRedirect = locationDetectLanguageAndRedirect;
52
+ exports.locationHashParamGet = locationHashParamGet;
53
+ exports.locationHashParamSet = locationHashParamSet;
54
+ exports.locationParamReload = locationParamReload;
55
+ exports.locationUpdate = locationUpdate;
56
+ //# sourceMappingURL=Location.cjs.map
57
+ //# sourceMappingURL=Location.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Location.ts"],"names":[],"mappings":";;;AAAA,IAAI,kBAAA,GAA6C,IAAA;A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EAAA,MAAM,gBACJ,SAAA,CAAU,QAAA,IACT,SAAA,EAAoD,YAAA,IACrD,IACA,WAAA,EAAY;AACd,EAAA,MAAM,WAAA,GAAc,OAAO,QAAA,CAAS,QAAA;AAEpC,EAAA,MAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,MAAM,CAAA;AACzC,EAAA,MAAM,OAAA,GAAU,aAAa,GAAA,CAAI,CAAC,QAAQ,GAAA,CAAI,OAAA,CAAQ,qBAAA,EAAuB,MAAM,CAAC,CAAA;AACpF,EAAA,MAAM,eAAA,GAAkB,IAAI,MAAA,CAAO,CAAA,EAAA,EAAK,QAAQ,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAG,CAAA;AAE5D,EAAA,IAAI,eAAA,CAAgB,IAAA,CAAK,WAAW,CAAA,EAAG;AACrC,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,cAAc,MAAA,CAAO,QAAA;AAEzB,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,KAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AAChD,IAAA,IAAI,SAAS,UAAA,EAAY;AACvB,MAAA;AAAA,IACF;AACA,IAAA,IAAI,YAAA,CAAa,UAAA,CAAW,IAAA,CAAK,WAAA,EAAa,CAAA,EAAG;AAC/C,MAAA,WAAA,GAAc,GAAA;AACd,MAAA;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,UAAA,GAAa,WAAA,CAAY,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAChD,EAAA,MAAA,CAAO,QAAA,CAAS,IAAA,GAAO,CAAA,EAAG,WAAW,GAAG,UAAU,CAAA,CAAA;AACpD","file":"Location.cjs","sourcesContent":["let locationParamsHash: URLSearchParams | null = null;\n\nexport function locationParamReload(): URLSearchParams {\n locationParamsHash = new URLSearchParams(window.location.hash.slice(1));\n return locationParamsHash;\n}\n\nexport function locationHashParamGet(name: string, defaultValue = ''): string {\n const params = locationParamReload();\n const value = params.get(name);\n return value !== null ? value : defaultValue;\n}\n\nexport function locationHashParamSet(name: string, value: string, ignoreHistory = false): void {\n const params = locationParamReload();\n params.set(name, value);\n\n const { pathname, search } = window.location;\n locationUpdate(`${pathname}${search}#${params.toString()}`, ignoreHistory);\n}\n\nexport function locationUpdate(href: string, ignoreHistory = false): void {\n let nextHref = href;\n\n if (nextHref.endsWith('#')) {\n nextHref = nextHref.slice(0, -1);\n }\n\n const method: 'pushState' | 'replaceState' = ignoreHistory ? 'replaceState' : 'pushState';\n window.history[method]({ manualState: true }, document.title, nextHref);\n}\n\nexport function locationDetectLanguageAndRedirect(\n config: Record<string, string> & { _default: string }\n): void {\n const userLanguage = (\n navigator.language ||\n (navigator as unknown as { userLanguage?: string })?.userLanguage ||\n ''\n ).toLowerCase();\n const currentPath = window.location.pathname;\n\n const redirectUrls = Object.values(config);\n const escaped = redirectUrls.map((url) => url.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'));\n const redirectPattern = new RegExp(`^(${escaped.join('|')})`);\n\n if (redirectPattern.test(currentPath)) {\n return;\n }\n\n let redirectUrl = config._default;\n\n for (const [lang, url] of Object.entries(config)) {\n if (lang === '_default') {\n continue;\n }\n if (userLanguage.startsWith(lang.toLowerCase())) {\n redirectUrl = url;\n break;\n }\n }\n\n const restOfPath = currentPath.replace(/^\\//, '');\n window.location.href = `${redirectUrl}${restOfPath}`;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ declare function locationParamReload(): URLSearchParams;
2
+ declare function locationHashParamGet(name: string, defaultValue?: string): string;
3
+ declare function locationHashParamSet(name: string, value: string, ignoreHistory?: boolean): void;
4
+ declare function locationUpdate(href: string, ignoreHistory?: boolean): void;
5
+ declare function locationDetectLanguageAndRedirect(config: Record<string, string> & {
6
+ _default: string;
7
+ }): void;
8
+
9
+ export { locationDetectLanguageAndRedirect, locationHashParamGet, locationHashParamSet, locationParamReload, locationUpdate };
@@ -0,0 +1,9 @@
1
+ declare function locationParamReload(): URLSearchParams;
2
+ declare function locationHashParamGet(name: string, defaultValue?: string): string;
3
+ declare function locationHashParamSet(name: string, value: string, ignoreHistory?: boolean): void;
4
+ declare function locationUpdate(href: string, ignoreHistory?: boolean): void;
5
+ declare function locationDetectLanguageAndRedirect(config: Record<string, string> & {
6
+ _default: string;
7
+ }): void;
8
+
9
+ export { locationDetectLanguageAndRedirect, locationHashParamGet, locationHashParamSet, locationParamReload, locationUpdate };
@@ -0,0 +1,51 @@
1
+ // src/Helper/Location.ts
2
+ var locationParamsHash = null;
3
+ function locationParamReload() {
4
+ locationParamsHash = new URLSearchParams(window.location.hash.slice(1));
5
+ return locationParamsHash;
6
+ }
7
+ function locationHashParamGet(name, defaultValue = "") {
8
+ const params = locationParamReload();
9
+ const value = params.get(name);
10
+ return value !== null ? value : defaultValue;
11
+ }
12
+ function locationHashParamSet(name, value, ignoreHistory = false) {
13
+ const params = locationParamReload();
14
+ params.set(name, value);
15
+ const { pathname, search } = window.location;
16
+ locationUpdate(`${pathname}${search}#${params.toString()}`, ignoreHistory);
17
+ }
18
+ function locationUpdate(href, ignoreHistory = false) {
19
+ let nextHref = href;
20
+ if (nextHref.endsWith("#")) {
21
+ nextHref = nextHref.slice(0, -1);
22
+ }
23
+ const method = ignoreHistory ? "replaceState" : "pushState";
24
+ window.history[method]({ manualState: true }, document.title, nextHref);
25
+ }
26
+ function locationDetectLanguageAndRedirect(config) {
27
+ const userLanguage = (navigator.language || navigator?.userLanguage || "").toLowerCase();
28
+ const currentPath = window.location.pathname;
29
+ const redirectUrls = Object.values(config);
30
+ const escaped = redirectUrls.map((url) => url.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
31
+ const redirectPattern = new RegExp(`^(${escaped.join("|")})`);
32
+ if (redirectPattern.test(currentPath)) {
33
+ return;
34
+ }
35
+ let redirectUrl = config._default;
36
+ for (const [lang, url] of Object.entries(config)) {
37
+ if (lang === "_default") {
38
+ continue;
39
+ }
40
+ if (userLanguage.startsWith(lang.toLowerCase())) {
41
+ redirectUrl = url;
42
+ break;
43
+ }
44
+ }
45
+ const restOfPath = currentPath.replace(/^\//, "");
46
+ window.location.href = `${redirectUrl}${restOfPath}`;
47
+ }
48
+
49
+ export { locationDetectLanguageAndRedirect, locationHashParamGet, locationHashParamSet, locationParamReload, locationUpdate };
50
+ //# sourceMappingURL=Location.js.map
51
+ //# sourceMappingURL=Location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Location.ts"],"names":[],"mappings":";AAAA,IAAI,kBAAA,GAA6C,IAAA;AAE1C,SAAS,mBAAA,GAAuC;AACrD,EAAA,kBAAA,GAAqB,IAAI,eAAA,CAAgB,MAAA,CAAO,SAAS,IAAA,CAAK,KAAA,CAAM,CAAC,CAAC,CAAA;AACtE,EAAA,OAAO,kBAAA;AACT;AAEO,SAAS,oBAAA,CAAqB,IAAA,EAAc,YAAA,GAAe,EAAA,EAAY;AAC5E,EAAA,MAAM,SAAS,mBAAA,EAAoB;AACnC,EAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,GAAA,CAAI,IAAI,CAAA;AAC7B,EAAA,OAAO,KAAA,KAAU,OAAO,KAAA,GAAQ,YAAA;AAClC;AAEO,SAAS,oBAAA,CAAqB,IAAA,EAAc,KAAA,EAAe,aAAA,GAAgB,KAAA,EAAa;AAC7F,EAAA,MAAM,SAAS,mBAAA,EAAoB;AACnC,EAAA,MAAA,CAAO,GAAA,CAAI,MAAM,KAAK,CAAA;AAEtB,EAAA,MAAM,EAAE,QAAA,EAAU,MAAA,EAAO,GAAI,MAAA,CAAO,QAAA;AACpC,EAAA,cAAA,CAAe,CAAA,EAAG,QAAQ,CAAA,EAAG,MAAM,IAAI,MAAA,CAAO,QAAA,EAAU,CAAA,CAAA,EAAI,aAAa,CAAA;AAC3E;AAEO,SAAS,cAAA,CAAe,IAAA,EAAc,aAAA,GAAgB,KAAA,EAAa;AACxE,EAAA,IAAI,QAAA,GAAW,IAAA;AAEf,EAAA,IAAI,QAAA,CAAS,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A,GAAa,WAAA,CAAY,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAChD,EAAA,MAAA,CAAO,QAAA,CAAS,IAAA,GAAO,CAAA,EAAG,WAAW,GAAG,UAAU,CAAA,CAAA;AACpD","file":"Location.js","sourcesContent":["let locationParamsHash: URLSearchParams | null = null;\n\nexport function locationParamReload(): URLSearchParams {\n locationParamsHash = new URLSearchParams(window.location.hash.slice(1));\n return locationParamsHash;\n}\n\nexport function locationHashParamGet(name: string, defaultValue = ''): string {\n const params = locationParamReload();\n const value = params.get(name);\n return value !== null ? value : defaultValue;\n}\n\nexport function locationHashParamSet(name: string, value: string, ignoreHistory = false): void {\n const params = locationParamReload();\n params.set(name, value);\n\n const { pathname, search } = window.location;\n locationUpdate(`${pathname}${search}#${params.toString()}`, ignoreHistory);\n}\n\nexport function locationUpdate(href: string, ignoreHistory = false): void {\n let nextHref = href;\n\n if (nextHref.endsWith('#')) {\n nextHref = nextHref.slice(0, -1);\n }\n\n const method: 'pushState' | 'replaceState' = ignoreHistory ? 'replaceState' : 'pushState';\n window.history[method]({ manualState: true }, document.title, nextHref);\n}\n\nexport function locationDetectLanguageAndRedirect(\n config: Record<string, string> & { _default: string }\n): void {\n const userLanguage = (\n navigator.language ||\n (navigator as unknown as { userLanguage?: string })?.userLanguage ||\n ''\n ).toLowerCase();\n const currentPath = window.location.pathname;\n\n const redirectUrls = Object.values(config);\n const escaped = redirectUrls.map((url) => url.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'));\n const redirectPattern = new RegExp(`^(${escaped.join('|')})`);\n\n if (redirectPattern.test(currentPath)) {\n return;\n }\n\n let redirectUrl = config._default;\n\n for (const [lang, url] of Object.entries(config)) {\n if (lang === '_default') {\n continue;\n }\n if (userLanguage.startsWith(lang.toLowerCase())) {\n redirectUrl = url;\n break;\n }\n }\n\n const restOfPath = currentPath.replace(/^\\//, '');\n window.location.href = `${redirectUrl}${restOfPath}`;\n}\n"]}
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/Log.ts
4
+ var COLORS = {
5
+ blue: "34",
6
+ cyan: "36",
7
+ gray: "90",
8
+ green: "32",
9
+ magenta: "35",
10
+ yellow: "33",
11
+ red: "31"
12
+ };
13
+ function logColor(text, colorCode = COLORS.gray) {
14
+ const resolved = typeof colorCode === "string" && colorCode in COLORS ? COLORS[colorCode] : colorCode || COLORS.gray;
15
+ return `\x1B[${resolved}m${text}\x1B[0m`;
16
+ }
17
+ function logTitle(title, colorCode = COLORS.cyan) {
18
+ console.log("");
19
+ console.log(logColor(`# ${String(title).toUpperCase()}`, colorCode));
20
+ }
21
+ function logPath(label, value, labelColor = COLORS.gray, valueColor = COLORS.yellow) {
22
+ console.log(`${logColor(label, labelColor)} ${logColor(value, valueColor)}`);
23
+ }
24
+ function logEntry(action, entry) {
25
+ console.log(
26
+ `${logColor("\u2022", COLORS.green)} ${logColor(action, COLORS.blue)} ${logColor(entry.output, COLORS.yellow)}`
27
+ );
28
+ console.log(` ${logColor("from", COLORS.gray)} ${logColor(entry.source, COLORS.gray)}`);
29
+ }
30
+
31
+ exports.COLORS = COLORS;
32
+ exports.logColor = logColor;
33
+ exports.logEntry = logEntry;
34
+ exports.logPath = logPath;
35
+ exports.logTitle = logTitle;
36
+ //# sourceMappingURL=Log.cjs.map
37
+ //# sourceMappingURL=Log.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Log.ts"],"names":[],"mappings":";;;AAAO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAA,EAAM,IAAA;AAAA,EACN,IAAA,EAAM,IAAA;AAAA,EACN,IAAA,EAAM,IAAA;AAAA,EACN,KAAA,EAAO,IAAA;AAAA,EACP,OAAA,EAAS,IAAA;AAAA,EACT,MAAA,EAAQ,IAAA;AAAA,EACR,GAAA,EAAK;AACP;AAIO,SAAS,QAAA,CAAS,IAAA,EAAc,SAAA,GAAwB,MAAA,CAAO,IAAA,EAAc;AAClF,EAAA,MAAM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"Log.cjs","sourcesContent":["export const COLORS = {\n blue: '34',\n cyan: '36',\n gray: '90',\n green: '32',\n magenta: '35',\n yellow: '33',\n red: '31',\n} as const;\n\ntype ColorValue = keyof typeof COLORS | string;\n\nexport function logColor(text: string, colorCode: ColorValue = COLORS.gray): string {\n const resolved =\n typeof colorCode === 'string' && colorCode in COLORS\n ? COLORS[colorCode as keyof typeof COLORS]\n : colorCode || COLORS.gray;\n\n return `\\x1b[${resolved}m${text}\\x1b[0m`;\n}\n\nexport function logTitle(title: string, colorCode: ColorValue = COLORS.cyan): void {\n console.log('');\n console.log(logColor(`# ${String(title).toUpperCase()}`, colorCode));\n}\n\nexport function logPath(\n label: string,\n value: string,\n labelColor: ColorValue = COLORS.gray,\n valueColor: ColorValue = COLORS.yellow\n): void {\n console.log(`${logColor(label, labelColor)} ${logColor(value, valueColor)}`);\n}\n\nexport function logEntry(action: string, entry: { output: string; source: string }): void {\n console.log(\n `${logColor('•', COLORS.green)} ${logColor(action, COLORS.blue)} ${logColor(entry.output, COLORS.yellow)}`\n );\n console.log(` ${logColor('from', COLORS.gray)} ${logColor(entry.source, COLORS.gray)}`);\n}\n"]}
@@ -0,0 +1,19 @@
1
+ declare const COLORS: {
2
+ readonly blue: "34";
3
+ readonly cyan: "36";
4
+ readonly gray: "90";
5
+ readonly green: "32";
6
+ readonly magenta: "35";
7
+ readonly yellow: "33";
8
+ readonly red: "31";
9
+ };
10
+ type ColorValue = keyof typeof COLORS | string;
11
+ declare function logColor(text: string, colorCode?: ColorValue): string;
12
+ declare function logTitle(title: string, colorCode?: ColorValue): void;
13
+ declare function logPath(label: string, value: string, labelColor?: ColorValue, valueColor?: ColorValue): void;
14
+ declare function logEntry(action: string, entry: {
15
+ output: string;
16
+ source: string;
17
+ }): void;
18
+
19
+ export { COLORS, logColor, logEntry, logPath, logTitle };
@@ -0,0 +1,19 @@
1
+ declare const COLORS: {
2
+ readonly blue: "34";
3
+ readonly cyan: "36";
4
+ readonly gray: "90";
5
+ readonly green: "32";
6
+ readonly magenta: "35";
7
+ readonly yellow: "33";
8
+ readonly red: "31";
9
+ };
10
+ type ColorValue = keyof typeof COLORS | string;
11
+ declare function logColor(text: string, colorCode?: ColorValue): string;
12
+ declare function logTitle(title: string, colorCode?: ColorValue): void;
13
+ declare function logPath(label: string, value: string, labelColor?: ColorValue, valueColor?: ColorValue): void;
14
+ declare function logEntry(action: string, entry: {
15
+ output: string;
16
+ source: string;
17
+ }): void;
18
+
19
+ export { COLORS, logColor, logEntry, logPath, logTitle };
@@ -0,0 +1,31 @@
1
+ // src/Helper/Log.ts
2
+ var COLORS = {
3
+ blue: "34",
4
+ cyan: "36",
5
+ gray: "90",
6
+ green: "32",
7
+ magenta: "35",
8
+ yellow: "33",
9
+ red: "31"
10
+ };
11
+ function logColor(text, colorCode = COLORS.gray) {
12
+ const resolved = typeof colorCode === "string" && colorCode in COLORS ? COLORS[colorCode] : colorCode || COLORS.gray;
13
+ return `\x1B[${resolved}m${text}\x1B[0m`;
14
+ }
15
+ function logTitle(title, colorCode = COLORS.cyan) {
16
+ console.log("");
17
+ console.log(logColor(`# ${String(title).toUpperCase()}`, colorCode));
18
+ }
19
+ function logPath(label, value, labelColor = COLORS.gray, valueColor = COLORS.yellow) {
20
+ console.log(`${logColor(label, labelColor)} ${logColor(value, valueColor)}`);
21
+ }
22
+ function logEntry(action, entry) {
23
+ console.log(
24
+ `${logColor("\u2022", COLORS.green)} ${logColor(action, COLORS.blue)} ${logColor(entry.output, COLORS.yellow)}`
25
+ );
26
+ console.log(` ${logColor("from", COLORS.gray)} ${logColor(entry.source, COLORS.gray)}`);
27
+ }
28
+
29
+ export { COLORS, logColor, logEntry, logPath, logTitle };
30
+ //# sourceMappingURL=Log.js.map
31
+ //# sourceMappingURL=Log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Log.ts"],"names":[],"mappings":";AAAO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAA,EAAM,IAAA;AAAA,EACN,IA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,MAAA,CAAO,MAAM,CAAC,CAAA;AAAA,GAC1G;AACA,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,IAAA,EAAO,QAAA,CAAS,MAAA,EAAQ,OAAO,IAAI,CAAC,CAAA,CAAA,EAAI,QAAA,CAAS,KAAA,CAAM,MAAA,EAAQ,MAAA,CAAO,IAAI,CAAC,CAAA,CAAE,CAAA;AAC3F","file":"Log.js","sourcesContent":["export const COLORS = {\n blue: '34',\n cyan: '36',\n gray: '90',\n green: '32',\n magenta: '35',\n yellow: '33',\n red: '31',\n} as const;\n\ntype ColorValue = keyof typeof COLORS | string;\n\nexport function logColor(text: string, colorCode: ColorValue = COLORS.gray): string {\n const resolved =\n typeof colorCode === 'string' && colorCode in COLORS\n ? COLORS[colorCode as keyof typeof COLORS]\n : colorCode || COLORS.gray;\n\n return `\\x1b[${resolved}m${text}\\x1b[0m`;\n}\n\nexport function logTitle(title: string, colorCode: ColorValue = COLORS.cyan): void {\n console.log('');\n console.log(logColor(`# ${String(title).toUpperCase()}`, colorCode));\n}\n\nexport function logPath(\n label: string,\n value: string,\n labelColor: ColorValue = COLORS.gray,\n valueColor: ColorValue = COLORS.yellow\n): void {\n console.log(`${logColor(label, labelColor)} ${logColor(value, valueColor)}`);\n}\n\nexport function logEntry(action: string, entry: { output: string; source: string }): void {\n console.log(\n `${logColor('•', COLORS.green)} ${logColor(action, COLORS.blue)} ${logColor(entry.output, COLORS.yellow)}`\n );\n console.log(` ${logColor('from', COLORS.gray)} ${logColor(entry.source, COLORS.gray)}`);\n}\n"]}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/Mixin.ts
4
+ function mixinApply(targetCtor, mixins) {
5
+ mixins.forEach((mixinCtor) => {
6
+ Object.getOwnPropertyNames(mixinCtor.prototype).forEach((name) => {
7
+ if (name === "constructor") {
8
+ return;
9
+ }
10
+ const descriptor = Object.getOwnPropertyDescriptor(mixinCtor.prototype, name);
11
+ if (descriptor) {
12
+ Object.defineProperty(targetCtor.prototype, name, descriptor);
13
+ }
14
+ });
15
+ Object.getOwnPropertyNames(mixinCtor).forEach((name) => {
16
+ if (["length", "name", "prototype"].includes(name)) {
17
+ return;
18
+ }
19
+ const descriptor = Object.getOwnPropertyDescriptor(mixinCtor, name);
20
+ if (descriptor) {
21
+ Object.defineProperty(targetCtor, name, descriptor);
22
+ }
23
+ });
24
+ });
25
+ }
26
+
27
+ exports.mixinApply = mixinApply;
28
+ //# sourceMappingURL=Mixin.cjs.map
29
+ //# sourceMappingURL=Mixin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Mixin.ts"],"names":[],"mappings":";;;AAMO,SAAS,UAAA,CAAW,YAAyB,MAAA,EAA6B;AAC/E,EAAA,MAAA,CAAO,OAAA,CAAQ,CAAC,SAAA,KAAc;AAE5B,IAAA,MAAA,CAAO,oBAAoB,SAAA,CAAU,SAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS;AAChE,MAAA,IAAI,SAAS,aAAA,EAAe;AAC1B,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAA,GAAa,MAAA,CAAO,wBAAA,CAAyB,SAAA,CAAU,WAAW,IAAI,CAAA;AAC5E,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,MAAA,CAAO,cAAA,CAAe,UAAA,CAAW,SAAA,EAAW,IAAA,EAAM,UAAU,CAAA;AAAA,MAC9D;AAAA,IACF,CAAC,CAAA;AAGD,IAAA,MAAA,CAAO,mBAAA,CAAoB,SAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS;AACtD,MAAA,IAAI,CAAC,QAAA,EAAU,MAAA,EAAQ,WAAW,CAAA,CAAE,QAAA,CAAS,IAAI,CAAA,EAAG;AAClD,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAA,GAAa,MAAA,CAAO,wBAAA,CAAyB,SAAA,EAAW,IAAI,CAAA;AAClE,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,MAAA,CAAO,cAAA,CAAe,UAAA,EAAY,IAAA,EAAM,UAAU,CAAA;AAAA,MACpD;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"Mixin.cjs","sourcesContent":["type Constructor<T = any> = abstract new (...args: any[]) => T;\n\n/**\n * Apply mixin classes to a target class (TypeScript-compatible).\n * Copy prototype properties (except constructor) and static props.\n */\nexport function mixinApply(targetCtor: Constructor, mixins: Constructor[]): void {\n mixins.forEach((mixinCtor) => {\n // Copy instance members (prototype).\n Object.getOwnPropertyNames(mixinCtor.prototype).forEach((name) => {\n if (name === 'constructor') {\n return;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(mixinCtor.prototype, name);\n if (descriptor) {\n Object.defineProperty(targetCtor.prototype, name, descriptor);\n }\n });\n\n // Copy static members if any (excluding length/name/prototype).\n Object.getOwnPropertyNames(mixinCtor).forEach((name) => {\n if (['length', 'name', 'prototype'].includes(name)) {\n return;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(mixinCtor, name);\n if (descriptor) {\n Object.defineProperty(targetCtor, name, descriptor);\n }\n });\n });\n}\n"]}
@@ -0,0 +1,8 @@
1
+ type Constructor<T = any> = abstract new (...args: any[]) => T;
2
+ /**
3
+ * Apply mixin classes to a target class (TypeScript-compatible).
4
+ * Copy prototype properties (except constructor) and static props.
5
+ */
6
+ declare function mixinApply(targetCtor: Constructor, mixins: Constructor[]): void;
7
+
8
+ export { mixinApply };
@@ -0,0 +1,8 @@
1
+ type Constructor<T = any> = abstract new (...args: any[]) => T;
2
+ /**
3
+ * Apply mixin classes to a target class (TypeScript-compatible).
4
+ * Copy prototype properties (except constructor) and static props.
5
+ */
6
+ declare function mixinApply(targetCtor: Constructor, mixins: Constructor[]): void;
7
+
8
+ export { mixinApply };
@@ -0,0 +1,27 @@
1
+ // src/Helper/Mixin.ts
2
+ function mixinApply(targetCtor, mixins) {
3
+ mixins.forEach((mixinCtor) => {
4
+ Object.getOwnPropertyNames(mixinCtor.prototype).forEach((name) => {
5
+ if (name === "constructor") {
6
+ return;
7
+ }
8
+ const descriptor = Object.getOwnPropertyDescriptor(mixinCtor.prototype, name);
9
+ if (descriptor) {
10
+ Object.defineProperty(targetCtor.prototype, name, descriptor);
11
+ }
12
+ });
13
+ Object.getOwnPropertyNames(mixinCtor).forEach((name) => {
14
+ if (["length", "name", "prototype"].includes(name)) {
15
+ return;
16
+ }
17
+ const descriptor = Object.getOwnPropertyDescriptor(mixinCtor, name);
18
+ if (descriptor) {
19
+ Object.defineProperty(targetCtor, name, descriptor);
20
+ }
21
+ });
22
+ });
23
+ }
24
+
25
+ export { mixinApply };
26
+ //# sourceMappingURL=Mixin.js.map
27
+ //# sourceMappingURL=Mixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Helper/Mixin.ts"],"names":[],"mappings":";AAMO,SAAS,UAAA,CAAW,YAAyB,MAAA,EAA6B;AAC/E,EAAA,MAAA,CAAO,OAAA,CAAQ,CAAC,SAAA,KAAc;AAE5B,IAAA,MAAA,CAAO,oBAAoB,SAAA,CAAU,SAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS;AAChE,MAAA,IAAI,SAAS,aAAA,EAAe;AAC1B,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAA,GAAa,MAAA,CAAO,wBAAA,CAAyB,SAAA,CAAU,WAAW,IAAI,CAAA;AAC5E,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,MAAA,CAAO,cAAA,CAAe,UAAA,CAAW,SAAA,EAAW,IAAA,EAAM,UAAU,CAAA;AAAA,MAC9D;AAAA,IACF,CAAC,CAAA;AAGD,IAAA,MAAA,CAAO,mBAAA,CAAoB,SAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,IAAA,KAAS;AACtD,MAAA,IAAI,CAAC,QAAA,EAAU,MAAA,EAAQ,WAAW,CAAA,CAAE,QAAA,CAAS,IAAI,CAAA,EAAG;AAClD,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAA,GAAa,MAAA,CAAO,wBAAA,CAAyB,SAAA,EAAW,IAAI,CAAA;AAClE,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,MAAA,CAAO,cAAA,CAAe,UAAA,EAAY,IAAA,EAAM,UAAU,CAAA;AAAA,MACpD;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"Mixin.js","sourcesContent":["type Constructor<T = any> = abstract new (...args: any[]) => T;\n\n/**\n * Apply mixin classes to a target class (TypeScript-compatible).\n * Copy prototype properties (except constructor) and static props.\n */\nexport function mixinApply(targetCtor: Constructor, mixins: Constructor[]): void {\n mixins.forEach((mixinCtor) => {\n // Copy instance members (prototype).\n Object.getOwnPropertyNames(mixinCtor.prototype).forEach((name) => {\n if (name === 'constructor') {\n return;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(mixinCtor.prototype, name);\n if (descriptor) {\n Object.defineProperty(targetCtor.prototype, name, descriptor);\n }\n });\n\n // Copy static members if any (excluding length/name/prototype).\n Object.getOwnPropertyNames(mixinCtor).forEach((name) => {\n if (['length', 'name', 'prototype'].includes(name)) {\n return;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(mixinCtor, name);\n if (descriptor) {\n Object.defineProperty(targetCtor, name, descriptor);\n }\n });\n });\n}\n"]}
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ // src/Helper/Object.ts
4
+ function objectMergeDeep(target = {}, source = {}) {
5
+ const output = { ...target };
6
+ Object.entries(source || {}).forEach(([key, value]) => {
7
+ if (value && typeof value === "object" && !Array.isArray(value)) {
8
+ output[key] = objectMergeDeep(
9
+ typeof output[key] === "object" && output[key] !== null ? output[key] : {},
10
+ value
11
+ );
12
+ } else {
13
+ output[key] = value;
14
+ }
15
+ });
16
+ return output;
17
+ }
18
+ function objectToType(value) {
19
+ return {}.toString.call(value).match(/([a-z]+)(:?\])/i)?.[1] ?? typeof value;
20
+ }
21
+ function objectIsPlainObject(value) {
22
+ return objectToType(value) === "Object";
23
+ }
24
+ function objectDeepAssignWithOptions(options) {
25
+ const mergedOptions = {
26
+ nonEnum: true,
27
+ symbols: true,
28
+ descriptors: true,
29
+ proto: true,
30
+ ...options
31
+ };
32
+ return (target, ...sources) => {
33
+ sources.forEach((source) => {
34
+ if (!objectIsPlainObject(source) || !objectIsPlainObject(target)) return;
35
+ const copyProperty = (property) => {
36
+ const descriptor = Object.getOwnPropertyDescriptor(source, property);
37
+ if (!descriptor) return;
38
+ if (descriptor.enumerable || mergedOptions.nonEnum) {
39
+ if (objectIsPlainObject(source[property]) && objectIsPlainObject(target[property])) {
40
+ descriptor.value = objectDeepAssignWithOptions(mergedOptions)(
41
+ target[property],
42
+ source[property]
43
+ );
44
+ }
45
+ if (mergedOptions.descriptors) {
46
+ Object.defineProperty(target, property, descriptor);
47
+ } else {
48
+ target[property] = descriptor.value;
49
+ }
50
+ }
51
+ };
52
+ Object.getOwnPropertyNames(source).forEach(copyProperty);
53
+ if (mergedOptions.symbols) {
54
+ Object.getOwnPropertySymbols(source).forEach(copyProperty);
55
+ }
56
+ if (mergedOptions.proto) {
57
+ const targetProto = Object.getPrototypeOf(target);
58
+ const sourceProto = Object.getPrototypeOf(source);
59
+ if (targetProto && sourceProto) {
60
+ objectDeepAssignWithOptions({ ...mergedOptions, proto: false })(targetProto, sourceProto);
61
+ }
62
+ }
63
+ });
64
+ return target;
65
+ };
66
+ }
67
+ function objectDeepAssign(...args) {
68
+ return objectDeepAssignWithOptions({
69
+ nonEnum: true,
70
+ symbols: true,
71
+ descriptors: true,
72
+ proto: true
73
+ }).apply(void 0, args);
74
+ }
75
+ function objectCallPrototypeMethodIfExists(self, methodName, args = []) {
76
+ const method = Object.getPrototypeOf(self)?.[methodName];
77
+ if (typeof method === "function") {
78
+ return method.apply(self, args);
79
+ }
80
+ return void 0;
81
+ }
82
+ function objectGetItemByPath(data, key, defaultValue = null, separator = ".") {
83
+ const keys = Array.isArray(key) ? key : key.split(separator);
84
+ let cursor = data;
85
+ for (const k of keys) {
86
+ if (cursor !== null && typeof cursor === "object" && k in cursor) {
87
+ cursor = cursor[k];
88
+ } else {
89
+ return defaultValue;
90
+ }
91
+ }
92
+ return cursor;
93
+ }
94
+
95
+ exports.objectCallPrototypeMethodIfExists = objectCallPrototypeMethodIfExists;
96
+ exports.objectDeepAssign = objectDeepAssign;
97
+ exports.objectDeepAssignWithOptions = objectDeepAssignWithOptions;
98
+ exports.objectGetItemByPath = objectGetItemByPath;
99
+ exports.objectIsPlainObject = objectIsPlainObject;
100
+ exports.objectMergeDeep = objectMergeDeep;
101
+ exports.objectToType = objectToType;
102
+ //# sourceMappingURL=Object.cjs.map
103
+ //# sourceMappingURL=Object.cjs.map