@limitlesspc/std 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.d.ts +2 -2
- package/dist/{chunk-QLHXN3HB.js → chunk-45OKCQRU.js} +1 -1
- package/dist/{chunk-KOZ6L23R.js → chunk-J24AGW2M.js} +2 -1
- package/dist/events.js +2 -2
- package/dist/gfx/index.js +2 -2
- package/dist/math/index.d.ts +1 -1
- package/dist/math/index.js +2 -2
- package/dist/random.d.ts +1 -1
- package/dist/random.js +1 -1
- package/package.json +1 -1
package/dist/array.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare function unorderedRemove<T>(array: T[], index: number): T | undefined;
|
|
|
58
58
|
* console.log(intersection([1, 2, 3], [4, 5, 6])); // []
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
declare function intersection<T>(...arrays:
|
|
61
|
+
declare function intersection<T>(...arrays: Array<readonly T[]>): T[];
|
|
62
62
|
/**
|
|
63
63
|
* Returns an array containing items found in the second array that are not in the first
|
|
64
64
|
* @param oldArray
|
|
@@ -243,6 +243,6 @@ declare function filterByKey<T>(array: readonly T[], key: keyof T): T[];
|
|
|
243
243
|
* // ]
|
|
244
244
|
* ```
|
|
245
245
|
*/
|
|
246
|
-
declare function sortByKeys<T, K extends keyof T>(array: T[], key: MaybeArray<K>, compare?: Compare<T[K]>): T[];
|
|
246
|
+
declare function sortByKeys<T, K extends keyof T>(array: readonly T[], key: MaybeArray<K>, compare?: Compare<T[K]>): T[];
|
|
247
247
|
|
|
248
248
|
export { added, changes, dedupe, dedupeBy, dedupeByKey, difference, equal, filterByKey, hasChange, includesAll, includesAny, intersection, remove, removed, sortByKeys, swap, union, unorderedRemove };
|
|
@@ -12,7 +12,8 @@ function random(min, max) {
|
|
|
12
12
|
return Math.random() * min;
|
|
13
13
|
}
|
|
14
14
|
const Min = Math.min(min, max);
|
|
15
|
-
|
|
15
|
+
const Max = Math.max(min, max);
|
|
16
|
+
return (Max - Min) * Math.random() + Min;
|
|
16
17
|
}
|
|
17
18
|
function randomInt(min = 0, max) {
|
|
18
19
|
if (typeof max === "number") {
|
package/dist/events.js
CHANGED
package/dist/gfx/index.js
CHANGED
package/dist/math/index.d.ts
CHANGED
|
@@ -289,7 +289,7 @@ declare function avg(iter: Iterable<number>): number;
|
|
|
289
289
|
* console.log(median2); // 3.5
|
|
290
290
|
* ```
|
|
291
291
|
*/
|
|
292
|
-
declare function median(array: number[]): number;
|
|
292
|
+
declare function median(array: readonly number[]): number;
|
|
293
293
|
/**
|
|
294
294
|
* Returns the mode, or most common, elements of an iterable
|
|
295
295
|
* @param iter The iterable of numbers
|
package/dist/math/index.js
CHANGED
|
@@ -55,8 +55,8 @@ import {
|
|
|
55
55
|
vec2,
|
|
56
56
|
vec3,
|
|
57
57
|
vec4
|
|
58
|
-
} from "../chunk-
|
|
59
|
-
import "../chunk-
|
|
58
|
+
} from "../chunk-45OKCQRU.js";
|
|
59
|
+
import "../chunk-J24AGW2M.js";
|
|
60
60
|
import "../chunk-4POIKW4G.js";
|
|
61
61
|
import "../chunk-CCBSTDYA.js";
|
|
62
62
|
import "../chunk-NXILTE26.js";
|
package/dist/random.d.ts
CHANGED
|
@@ -63,6 +63,6 @@ declare function choices<T>(array: ArrayLike<T>, n: uint): T[];
|
|
|
63
63
|
* @param n number of items to pick
|
|
64
64
|
* @returns an array containing the random items
|
|
65
65
|
*/
|
|
66
|
-
declare function sample<T>(array:
|
|
66
|
+
declare function sample<T>(array: readonly T[], n: uint): T[];
|
|
67
67
|
|
|
68
68
|
export { choice, choices, random, randomInt, sample, shuffle };
|
package/dist/random.js
CHANGED