Skip to content

Commit a042edb

Browse files
authored
Merge pull request #56 from Sv443-Network/ver/1.18.1
2 parents c838a05 + c1c008e commit a042edb

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

SvCoreLib.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ declare module "svcorelib" {
152152
* @param array The array to split
153153
* @param partsAmt Into how many parts the array should be split
154154
* @param balanced Default (false): returned parts all have the same length except the last one. (true): returned parts are equally balanced and have similar lengths.
155+
* @since 1.18.0
155156
*/
156157
function splitIntoParts<T>(array: T[], partsAmt: number, balanced?: boolean): T[][];
157158

158159
/**
159160
* 🔹 Splits an array into any number of parts with a max length. 🔹
160161
* @param array The array to split
161162
* @param maxLength The maximum length of each part. Has to be at least 1 or higher.
163+
* @since 1.18.0
162164
*/
163165
function splitIntoPartsOfLength<T>(array: T[], maxLength: number): T[][];
164166

@@ -305,23 +307,23 @@ declare module "svcorelib" {
305307
* @returns Returns a random item of the provided array. Returns undefined if the array is empty.
306308
* @since 1.9.4
307309
*/
308-
function randomItem<T>(array: T[]): T | undefined;
310+
function randomItem<T>(array: T[]): T;
309311

310312
/**
311313
* 🔹 Chooses a random item in an array and returns it, along with its index in the array. 🔹
312314
* @param array An array of any size, with any values contained inside
313315
* @returns Returns a tuple array with two entries. First entry is the randomly chosen item, second entry is the index of the random item. Returns undefined if the array is empty.
314316
* @since 1.17.0
315317
*/
316-
function randomItemIndex<T>(array: T[]): [item?: T, index?: number];
318+
function randomItemIndex<T>(array: T[]): [item: T, index: number];
317319

318320
/**
319321
* 🔹 Chooses a random item in an array and returns it. Mutates the original array so the chosen item is no longer contained! 🔹
320322
* @param array An array of any size, with any values contained inside
321323
* @returns Returns the randomly chosen item. Returns undefined if the array is empty.
322324
* @since 1.17.0
323325
*/
324-
function takeRandomItem<T>(array: T[]): T | undefined;
326+
function takeRandomItem<T>(array: T[]): T;
325327

326328
/**
327329
* 🔹 Removes duplicate items in an array 🔹

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svcorelib",
3-
"version": "1.18.0",
3+
"version": "1.18.1",
44
"description": "Core Library used in the projects of Sv443 and the Sv443 Network. Contains tons of miscellaneous QoL features.",
55
"main": "SvCoreLib.js",
66
"scripts": {
@@ -63,4 +63,4 @@
6363
"eslint": "^8.25.0",
6464
"snyk": "^1.1026.0"
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)