tiny-essentials 1.25.1 โ 1.25.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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Release Notes ๐
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- Fixed jsDoc issues in `multiplyArrayBlocks` function. ๐ ๏ธ
|
|
5
|
+
- Fixed jsDoc issues in `shuffleArray` function. ๐ ๏ธ
|
|
6
|
+
|
|
7
|
+
*Improved documentation for better code clarity!* โจ
|
|
8
|
+
|
|
9
|
+
**Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.25.1...1.25.2
|
package/dist/v1/basics/array.cjs
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* This implementation ensures a uniform distribution of permutations.
|
|
9
9
|
* Original algorithm source: StackOverflow (link above).
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
11
|
+
* @template {any[]} T
|
|
12
|
+
* @param {T} items - The array to shuffle.
|
|
13
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
13
14
|
*/
|
|
14
15
|
function shuffleArray(items) {
|
|
15
16
|
let currentIndex = items.length,
|
|
@@ -31,9 +32,9 @@ function shuffleArray(items) {
|
|
|
31
32
|
/**
|
|
32
33
|
* Generates an array with repeated phases according to counts.
|
|
33
34
|
*
|
|
34
|
-
* @param {
|
|
35
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
35
36
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
36
|
-
* @returns {
|
|
37
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
37
38
|
*/
|
|
38
39
|
function multiplyArrayBlocks(phases, counts) {
|
|
39
40
|
// phases: array de strings, cada fase (ex: ['Full', 'Half1', 'Half2', 'New'])
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
* This implementation ensures a uniform distribution of permutations.
|
|
5
5
|
* Original algorithm source: StackOverflow (link above).
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
7
|
+
* @template {any[]} T
|
|
8
|
+
* @param {T} items - The array to shuffle.
|
|
9
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
9
10
|
*/
|
|
10
|
-
export function shuffleArray(items:
|
|
11
|
+
export function shuffleArray<T extends any[]>(items: T): T;
|
|
11
12
|
/**
|
|
12
13
|
* Generates an array with repeated phases according to counts.
|
|
13
14
|
*
|
|
14
|
-
* @param {
|
|
15
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
15
16
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
16
|
-
* @returns {
|
|
17
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
17
18
|
*/
|
|
18
|
-
export function multiplyArrayBlocks(phases:
|
|
19
|
+
export function multiplyArrayBlocks(phases: any[], counts: number[]): any[];
|
|
19
20
|
/**
|
|
20
21
|
* Diff two class lists.
|
|
21
22
|
* @param {any[]} oldItems
|
package/dist/v1/basics/array.mjs
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* This implementation ensures a uniform distribution of permutations.
|
|
6
6
|
* Original algorithm source: StackOverflow (link above).
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
8
|
+
* @template {any[]} T
|
|
9
|
+
* @param {T} items - The array to shuffle.
|
|
10
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
10
11
|
*/
|
|
11
12
|
export function shuffleArray(items) {
|
|
12
13
|
let currentIndex = items.length, randomIndex;
|
|
@@ -23,9 +24,9 @@ export function shuffleArray(items) {
|
|
|
23
24
|
/**
|
|
24
25
|
* Generates an array with repeated phases according to counts.
|
|
25
26
|
*
|
|
26
|
-
* @param {
|
|
27
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
27
28
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
28
|
-
* @returns {
|
|
29
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
29
30
|
*/
|
|
30
31
|
export function multiplyArrayBlocks(phases, counts) {
|
|
31
32
|
// phases: array de strings, cada fase (ex: ['Full', 'Half1', 'Half2', 'New'])
|
package/docs/v1/basics/array.md
CHANGED
|
@@ -4,11 +4,11 @@ A minimal and handy module offering a couple of focused utilities for working wi
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
## `shuffleArray(items:
|
|
7
|
+
## `shuffleArray(items: any[]): any[]`
|
|
8
8
|
|
|
9
9
|
๐ A tiny utility for shuffling arrays using the good old FisherโYates algorithm. Simple, efficient, and perfectly random (as far as JavaScript's `Math.random()` allows, anyway).
|
|
10
10
|
|
|
11
|
-
- **items** โ An array
|
|
11
|
+
- **items** โ An array to shuffle.
|
|
12
12
|
- **Returns** โ The same array instance, but now shuffled.
|
|
13
13
|
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.2",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|