adaptive-extender 0.2.6 → 0.2.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 (139) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/core/color.js +176 -179
  3. package/dist/core/color.js.map +1 -1
  4. package/dist/core/random.js +26 -18
  5. package/dist/core/random.js.map +1 -1
  6. package/dist/dom/index.js.map +1 -0
  7. package/package.json +1 -1
  8. package/dist/core/core/array.d.ts +0 -42
  9. package/dist/core/core/array.js +0 -40
  10. package/dist/core/core/array.js.map +0 -1
  11. package/dist/core/core/boolean.d.ts +0 -14
  12. package/dist/core/core/boolean.js +0 -8
  13. package/dist/core/core/boolean.js.map +0 -1
  14. package/dist/core/core/color.d.ts +0 -369
  15. package/dist/core/core/color.js +0 -540
  16. package/dist/core/core/color.js.map +0 -1
  17. package/dist/core/core/date.d.ts +0 -27
  18. package/dist/core/core/date.js +0 -18
  19. package/dist/core/core/date.js.map +0 -1
  20. package/dist/core/core/error.d.ts +0 -20
  21. package/dist/core/core/error.js +0 -20
  22. package/dist/core/core/error.js.map +0 -1
  23. package/dist/core/core/global.d.ts +0 -14
  24. package/dist/core/core/global.js +0 -13
  25. package/dist/core/core/global.js.map +0 -1
  26. package/dist/core/core/index.d.ts +0 -17
  27. package/dist/core/core/index.js +0 -16
  28. package/dist/core/core/index.js.map +0 -1
  29. package/dist/core/core/math.d.ts +0 -44
  30. package/dist/core/core/math.js +0 -43
  31. package/dist/core/core/math.js.map +0 -1
  32. package/dist/core/core/number.d.ts +0 -59
  33. package/dist/core/core/number.js +0 -51
  34. package/dist/core/core/number.js.map +0 -1
  35. package/dist/core/core/object.d.ts +0 -30
  36. package/dist/core/core/object.js +0 -21
  37. package/dist/core/core/object.js.map +0 -1
  38. package/dist/core/core/primitives.d.ts +0 -10
  39. package/dist/core/core/primitives.js +0 -3
  40. package/dist/core/core/primitives.js.map +0 -1
  41. package/dist/core/core/promise.d.ts +0 -28
  42. package/dist/core/core/promise.js +0 -58
  43. package/dist/core/core/promise.js.map +0 -1
  44. package/dist/core/core/random.d.ts +0 -103
  45. package/dist/core/core/random.js +0 -114
  46. package/dist/core/core/random.js.map +0 -1
  47. package/dist/core/core/string.d.ts +0 -67
  48. package/dist/core/core/string.js +0 -44
  49. package/dist/core/core/string.js.map +0 -1
  50. package/dist/dom/core/array.d.ts +0 -42
  51. package/dist/dom/core/array.js +0 -40
  52. package/dist/dom/core/array.js.map +0 -1
  53. package/dist/dom/core/boolean.d.ts +0 -14
  54. package/dist/dom/core/boolean.js +0 -8
  55. package/dist/dom/core/boolean.js.map +0 -1
  56. package/dist/dom/core/color.d.ts +0 -369
  57. package/dist/dom/core/color.js +0 -540
  58. package/dist/dom/core/color.js.map +0 -1
  59. package/dist/dom/core/date.d.ts +0 -27
  60. package/dist/dom/core/date.js +0 -18
  61. package/dist/dom/core/date.js.map +0 -1
  62. package/dist/dom/core/error.d.ts +0 -20
  63. package/dist/dom/core/error.js +0 -20
  64. package/dist/dom/core/error.js.map +0 -1
  65. package/dist/dom/core/global.d.ts +0 -14
  66. package/dist/dom/core/global.js +0 -13
  67. package/dist/dom/core/global.js.map +0 -1
  68. package/dist/dom/core/index.d.ts +0 -17
  69. package/dist/dom/core/index.js +0 -16
  70. package/dist/dom/core/index.js.map +0 -1
  71. package/dist/dom/core/math.d.ts +0 -44
  72. package/dist/dom/core/math.js +0 -43
  73. package/dist/dom/core/math.js.map +0 -1
  74. package/dist/dom/core/number.d.ts +0 -59
  75. package/dist/dom/core/number.js +0 -51
  76. package/dist/dom/core/number.js.map +0 -1
  77. package/dist/dom/core/object.d.ts +0 -30
  78. package/dist/dom/core/object.js +0 -21
  79. package/dist/dom/core/object.js.map +0 -1
  80. package/dist/dom/core/primitives.d.ts +0 -10
  81. package/dist/dom/core/primitives.js +0 -3
  82. package/dist/dom/core/primitives.js.map +0 -1
  83. package/dist/dom/core/promise.d.ts +0 -28
  84. package/dist/dom/core/promise.js +0 -58
  85. package/dist/dom/core/promise.js.map +0 -1
  86. package/dist/dom/core/random.d.ts +0 -103
  87. package/dist/dom/core/random.js +0 -114
  88. package/dist/dom/core/random.js.map +0 -1
  89. package/dist/dom/core/string.d.ts +0 -67
  90. package/dist/dom/core/string.js +0 -44
  91. package/dist/dom/core/string.js.map +0 -1
  92. package/dist/dom/dom/index.js.map +0 -1
  93. package/dist/node/core/array.d.ts +0 -42
  94. package/dist/node/core/array.js +0 -40
  95. package/dist/node/core/array.js.map +0 -1
  96. package/dist/node/core/boolean.d.ts +0 -14
  97. package/dist/node/core/boolean.js +0 -8
  98. package/dist/node/core/boolean.js.map +0 -1
  99. package/dist/node/core/color.d.ts +0 -369
  100. package/dist/node/core/color.js +0 -540
  101. package/dist/node/core/color.js.map +0 -1
  102. package/dist/node/core/date.d.ts +0 -27
  103. package/dist/node/core/date.js +0 -18
  104. package/dist/node/core/date.js.map +0 -1
  105. package/dist/node/core/error.d.ts +0 -20
  106. package/dist/node/core/error.js +0 -20
  107. package/dist/node/core/error.js.map +0 -1
  108. package/dist/node/core/global.d.ts +0 -14
  109. package/dist/node/core/global.js +0 -13
  110. package/dist/node/core/global.js.map +0 -1
  111. package/dist/node/core/index.d.ts +0 -17
  112. package/dist/node/core/index.js +0 -16
  113. package/dist/node/core/index.js.map +0 -1
  114. package/dist/node/core/math.d.ts +0 -44
  115. package/dist/node/core/math.js +0 -43
  116. package/dist/node/core/math.js.map +0 -1
  117. package/dist/node/core/number.d.ts +0 -59
  118. package/dist/node/core/number.js +0 -51
  119. package/dist/node/core/number.js.map +0 -1
  120. package/dist/node/core/object.d.ts +0 -30
  121. package/dist/node/core/object.js +0 -21
  122. package/dist/node/core/object.js.map +0 -1
  123. package/dist/node/core/primitives.d.ts +0 -10
  124. package/dist/node/core/primitives.js +0 -3
  125. package/dist/node/core/primitives.js.map +0 -1
  126. package/dist/node/core/promise.d.ts +0 -28
  127. package/dist/node/core/promise.js +0 -58
  128. package/dist/node/core/promise.js.map +0 -1
  129. package/dist/node/core/random.d.ts +0 -103
  130. package/dist/node/core/random.js +0 -114
  131. package/dist/node/core/random.js.map +0 -1
  132. package/dist/node/core/string.d.ts +0 -67
  133. package/dist/node/core/string.js +0 -44
  134. package/dist/node/core/string.js.map +0 -1
  135. package/dist/node/node/index.d.ts +0 -8
  136. package/dist/node/node/index.js +0 -7
  137. package/dist/node/node/index.js.map +0 -1
  138. /package/dist/dom/{dom/index.d.ts → index.d.ts} +0 -0
  139. /package/dist/dom/{dom/index.js → index.js} +0 -0
@@ -1,114 +0,0 @@
1
- "use strict";
2
- const { random, trunc } = Math;
3
- //#region Random
4
- /**
5
- * Provides utility methods for generating random values.
6
- */
7
- class Random {
8
- static #global = new Random();
9
- /**
10
- * Gets the global shared random generator instance.
11
- * @readonly
12
- */
13
- static get global() {
14
- return Random.#global;
15
- }
16
- boolean(factor = 0.5) {
17
- if (!Number.isFinite(factor))
18
- throw new Error(`The factor ${factor} must be a finite number`);
19
- if (0 > factor || factor > 1)
20
- throw new RangeError(`The factor ${factor} is out of range [0 - 1]`);
21
- return random() < factor;
22
- }
23
- #number(min, max) {
24
- return random() * (max - min) + min;
25
- }
26
- number(arg1, arg2) {
27
- if (arg1 === undefined)
28
- return this.#number(-Number.MAX_VALUE, Number.MAX_VALUE);
29
- if (arg2 === undefined)
30
- return this.#number(0, arg1);
31
- return this.#number(arg1, arg2);
32
- }
33
- #integer(min, max) {
34
- return trunc(this.#number(min, max + 1));
35
- }
36
- integer(arg1, arg2) {
37
- if (arg1 === undefined)
38
- return this.#integer(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
39
- if (arg2 === undefined)
40
- return this.#integer(0, arg1);
41
- return this.#integer(arg1, arg2);
42
- }
43
- /**
44
- * Selects a random item from a non-empty array.
45
- * @param array The array to pick from.
46
- * @returns A random element from the array.
47
- * @throws {Error} If the array is empty.
48
- */
49
- item(array) {
50
- if (array.length < 1)
51
- throw new Error(`Array must have at least 1 item`);
52
- return array[this.#integer(0, array.length - 1)];
53
- }
54
- /**
55
- * Creates a shuffled range of numbers between `min` and `max`.
56
- * @param min Minimum value (inclusive).
57
- * @param max Maximum value (inclusive).
58
- * @returns An array of shuffled numbers in the specified range.
59
- */
60
- range(min, max) {
61
- const array = Array.range(min, max);
62
- this.shuffle(array);
63
- return array;
64
- }
65
- subarray(array, count = array.length) {
66
- if (!Number.isInteger(count))
67
- throw new Error(`The count ${count} must be a finite integer number`);
68
- if (0 > count || count > array.length)
69
- throw new RangeError(`The count ${count} is out of range [0 - ${array.length}]`);
70
- const clone = Array.from(array);
71
- const subarray = [];
72
- for (let index = 0; index < count; index++) {
73
- subarray.push(...clone.splice(this.#integer(0, clone.length - 1), 1));
74
- }
75
- return subarray;
76
- }
77
- /**
78
- * Randomly shuffles the order of elements in an array in place.
79
- * @param array The array to shuffle.
80
- */
81
- shuffle(array) {
82
- for (let index = 0; index < array.length - 1; index++) {
83
- const pair = this.#integer(index, array.length - 1);
84
- if (pair === index)
85
- continue;
86
- array.swap(index, pair);
87
- }
88
- }
89
- /**
90
- * Selects a random key from a map based on assigned weights.
91
- * @param cases A map of items to their respective weights.
92
- * @returns A randomly selected item based on weights.
93
- * @throws {Error} If the map is empty.
94
- * @throws {Error} If no item can be selected.
95
- */
96
- case(cases) {
97
- if (1 > cases.size)
98
- throw new Error(`The cases must have at least 1 item`);
99
- const summary = Array.from(cases).reduce((previous, [, weight]) => previous + weight, 0);
100
- const random = this.#number(0, summary);
101
- let begin = 0;
102
- for (const [item, weight] of cases) {
103
- const end = begin + weight;
104
- if (begin <= random && random < end)
105
- return item;
106
- begin = end;
107
- }
108
- throw new Error(`Unable to select element with value ${random}`);
109
- }
110
- ;
111
- }
112
- //#endregion
113
- export { Random };
114
- //# sourceMappingURL=random.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"random.js","sourceRoot":"","sources":["../../../src/core/random.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE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;YACjD,KAAK,GAAG,GAAG,CAAC;QACb,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAAA,CAAC;;AAEH,YAAY;AAEZ,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,67 +0,0 @@
1
- import "./global.js";
2
- declare global {
3
- interface StringConstructor {
4
- /**
5
- * Imports a string from a source.
6
- * @param source The source value to import.
7
- * @param name The name of the source value.
8
- * @returns The imported string value.
9
- * @throws {TypeError} If the source is not a string.
10
- */
11
- import(source: any, name?: string): string;
12
- /**
13
- * A constant empty string.
14
- * @readonly
15
- */
16
- empty: string;
17
- /**
18
- * Checks if a string is empty.
19
- * @param text The string to check.
20
- * @returns True if the string is empty, otherwise false.
21
- */
22
- isEmpty(text: string): boolean;
23
- /**
24
- * Checks if a string contains only whitespace characters.
25
- * @param text The string to check.
26
- * @returns True if the string is empty or contains only whitespace, otherwise false.
27
- */
28
- isWhitespace(text: string): boolean;
29
- }
30
- interface String {
31
- /**
32
- * Returns the current string unless it is empty, replacing it with the provided value.
33
- * @param value The fallback value.
34
- * @returns The original string or the fallback.
35
- */
36
- insteadEmpty<T>(value: T): string | T;
37
- /**
38
- * Returns the current string unless it consists only of whitespace, replacing it with the provided value.
39
- * @param value The fallback value.
40
- * @returns The original string or the fallback.
41
- */
42
- insteadWhitespace<T>(value: T): string | T;
43
- /**
44
- * Converts the string to title case, where the first letter of each word is capitalized.
45
- * @returns The string converted to title case.
46
- */
47
- toTitleCase(): string;
48
- /**
49
- * Converts the string to title case based on the specified locale(s), capitalizing the first letter of each word.
50
- * @param locales A single locale or an array of locales for locale-aware case conversion.
51
- * @returns The string converted to title case with locale-awareness.
52
- */
53
- toLocalTitleCase(locales?: string | string[]): string;
54
- /**
55
- * Converts the string to title case based on the specified locale(s), capitalizing the first letter of each word.
56
- * @param locales An argument supported by `Intl` for locale-aware case conversion.
57
- * @returns The string converted to title case with locale-awareness.
58
- */
59
- toLocalTitleCase(locales?: Intl.LocalesArgument): string;
60
- /**
61
- * Reverses the string.
62
- * @returns The reversed string.
63
- */
64
- reverse(): string;
65
- }
66
- }
67
- export {};
@@ -1,44 +0,0 @@
1
- "use strict";
2
- import "./global.js";
3
- String.import = function (source, name = "[source]") {
4
- if (typeof (source) !== "string")
5
- throw new TypeError(`Unable to import string from ${name} due its ${typename(source)} type`);
6
- return source.valueOf();
7
- };
8
- Object.defineProperty(String, "empty", {
9
- value: "",
10
- writable: false,
11
- });
12
- String.isEmpty = function (text) {
13
- return (text.length === 0);
14
- };
15
- String.isWhitespace = function (text) {
16
- return String.isEmpty(text.trimStart());
17
- };
18
- String.prototype.insteadEmpty = function (value) {
19
- const current = this.valueOf();
20
- if (String.isEmpty(current))
21
- return value;
22
- return current;
23
- };
24
- String.prototype.insteadWhitespace = function (value) {
25
- const current = this.valueOf();
26
- if (String.isWhitespace(current))
27
- return value;
28
- return current;
29
- };
30
- const patternWordsFirstLetter = /\b\w/g;
31
- String.prototype.toTitleCase = function () {
32
- return this.toLowerCase().replace(patternWordsFirstLetter, char => char.toUpperCase());
33
- };
34
- String.prototype.toLocalTitleCase = function (locales) {
35
- return this.toLocaleLowerCase(locales).replace(patternWordsFirstLetter, char => char.toLocaleUpperCase(locales));
36
- };
37
- String.prototype.reverse = function () {
38
- let string = String.empty;
39
- for (let index = this.length - 1; index >= 0; index--) {
40
- string += this[index];
41
- }
42
- return string;
43
- };
44
- //# sourceMappingURL=string.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src/core/string.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,aAAa,CAAC;AAqErB,MAAM,CAAC,MAAM,GAAG,UAAU,MAAW,EAAE,OAAe,UAAU;IAC/D,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,IAAI,YAAY,QAAQ,CAAC,MAAM,CAAC,OA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OAAO,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AAClH,CAAC,CAAC;AAEF,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG;IAC1B,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;IAC1B,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC"}
@@ -1,42 +0,0 @@
1
- import "./global.js";
2
- declare global {
3
- interface ArrayConstructor {
4
- /**
5
- * Imports an array from a source.
6
- * @param source The source to import from.
7
- * @param name The name of the source.
8
- * @returns The imported array.
9
- * @throws {TypeError} If the source is not an array.
10
- */
11
- import(source: any, name?: string): any[];
12
- /**
13
- * Creates an array of integers between the specified minimum and maximum values (exclusive).
14
- * @param min The minimum value of the range (inclusive).
15
- * @param max The maximum value of the range (exclusive).
16
- */
17
- range(min: number, max: number): number[];
18
- /**
19
- * Combines elements from multiple iterables into tuples.
20
- * Iteration stops when the shortest iterable is exhausted.
21
- * @returns A generator yielding tuples.
22
- */
23
- zip<T extends unknown[]>(...iterables: {
24
- [K in keyof T]: Iterable<T[K]>;
25
- }): Generator<T, void>;
26
- }
27
- interface Array<T> {
28
- /**
29
- * Swaps the elements at the given indices in the array.
30
- * @param index1 The index of the first element.
31
- * @param index2 The index of the second element.
32
- */
33
- swap(index1: number, index2: number): void;
34
- /**
35
- * Resizes the array to a specified length, filling with a default value if extended.
36
- * @param length The new length of the array.
37
- * @param _default The value used to fill when the array grows.
38
- */
39
- resize(length: number, _default: T): T[];
40
- }
41
- }
42
- export {};
@@ -1,40 +0,0 @@
1
- "use strict";
2
- import "./global.js";
3
- const { trunc } = Math;
4
- Array.import = function (source, name = "[source]") {
5
- if (!Array.isArray(source))
6
- throw new TypeError(`Unable to import array from ${name} due its ${typename(source)} type`);
7
- return source;
8
- };
9
- Array.range = function (min, max) {
10
- min = trunc(min);
11
- max = trunc(max);
12
- const array = [];
13
- for (let index = 0; index < max - min; index++) {
14
- array.push(index + min);
15
- }
16
- return array;
17
- };
18
- Array.zip = function* (...iterables) {
19
- const iterators = iterables.map(iterable => iterable[Symbol.iterator]());
20
- while (true) {
21
- const results = iterators.map(iterator => iterator.next());
22
- if (results.some(result => result.done))
23
- break;
24
- yield results.map(result => result.value);
25
- }
26
- };
27
- Array.prototype.swap = function (index1, index2) {
28
- index1 = trunc(index1);
29
- index2 = trunc(index2);
30
- const temporary = this[index1];
31
- this[index1] = this[index2];
32
- this[index2] = temporary;
33
- };
34
- Array.prototype.resize = function (length, _default) {
35
- while (length > this.length)
36
- this.push(_default);
37
- this.length = length;
38
- return this;
39
- };
40
- //# sourceMappingURL=array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/core/array.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,aAAa,CAAC;AAErB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;AA0CvB,KAAK,CAAC,MAAM,GAAG,UAAU,MAAW,EAAE,OAAe,UAAU;IAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,+BAA+B,IAAI,YAAY,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxH,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,KAAK,CAAC,KAAK,GAAG,UAAU,GAAW,EAAE,GAAW;IAC/C,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC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E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,OAAO,IAAI,CAAC;AACb,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import "./global.js";
2
- declare global {
3
- interface BooleanConstructor {
4
- /**
5
- * Imports a boolean value from a source.
6
- * @param source The source value to import.
7
- * @param name The name of the source value.
8
- * @returns The imported boolean value.
9
- * @throws {TypeError} If the source is not a boolean.
10
- */
11
- import(source: any, name?: string): boolean;
12
- }
13
- }
14
- export {};
@@ -1,8 +0,0 @@
1
- "use strict";
2
- import "./global.js";
3
- Boolean.import = function (source, name = "[source]") {
4
- if (typeof (source) !== "boolean")
5
- throw new TypeError(`Unable to import boolean from ${name} due its ${typename(source)} type`);
6
- return source.valueOf();
7
- };
8
- //# sourceMappingURL=boolean.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/core/boolean.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,aAAa,CAAC;AAerB,OAAO,CAAC,MAAM,GAAG,UAAU,MAAW,EAAE,OAAe,UAAU;IAChE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,SAAS,CAAC,iCAAiC,IAAI,YAAY,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjI,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC;AACzB,CAAC,CAAC"}