@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 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: ReadonlyArray<readonly T[]>): T[];
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 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  random
3
- } from "./chunk-KOZ6L23R.js";
3
+ } from "./chunk-J24AGW2M.js";
4
4
  import {
5
5
  chunk,
6
6
  collect,
@@ -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
- return (Math.max(min, max) - Min) * Math.random() + Min;
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  sum
3
- } from "./chunk-QLHXN3HB.js";
4
- import "./chunk-KOZ6L23R.js";
3
+ } from "./chunk-45OKCQRU.js";
4
+ import "./chunk-J24AGW2M.js";
5
5
  import "./chunk-4POIKW4G.js";
6
6
  import {
7
7
  pick
package/dist/gfx/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vec3
3
- } from "../chunk-QLHXN3HB.js";
4
- import "../chunk-KOZ6L23R.js";
3
+ } from "../chunk-45OKCQRU.js";
4
+ import "../chunk-J24AGW2M.js";
5
5
  import "../chunk-4POIKW4G.js";
6
6
  import "../chunk-CCBSTDYA.js";
7
7
  import "../chunk-NXILTE26.js";
@@ -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
@@ -55,8 +55,8 @@ import {
55
55
  vec2,
56
56
  vec3,
57
57
  vec4
58
- } from "../chunk-QLHXN3HB.js";
59
- import "../chunk-KOZ6L23R.js";
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: ArrayLike<T> & Iterable<T>, n: uint): T[];
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
@@ -5,7 +5,7 @@ import {
5
5
  randomInt,
6
6
  sample,
7
7
  shuffle
8
- } from "./chunk-KOZ6L23R.js";
8
+ } from "./chunk-J24AGW2M.js";
9
9
  import "./chunk-4POIKW4G.js";
10
10
  import "./chunk-CCBSTDYA.js";
11
11
  import "./chunk-NXILTE26.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@limitlesspc/std",
3
3
  "type": "module",
4
- "version": "0.23.1",
4
+ "version": "0.23.2",
5
5
  "description": "A standard library for JavaScript",
6
6
  "license": "MIT",
7
7
  "exports": {