isaacscript-common 1.0.552 → 1.0.553
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.
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to combine arrays. Returns a new array that is the composition of all of the
|
|
5
|
+
* specified arrays. This function is variadic, meaning that you can specify N arguments to combine
|
|
6
|
+
* N arrays. Note that this will only perform a shallow copy of the array elements.
|
|
7
|
+
*/
|
|
8
|
+
export declare function arrayCombine<T>(...arrays: T[][]): T[];
|
|
9
|
+
/** Helper function to perform a shallow copy. */
|
|
4
10
|
export declare function arrayCopy<T>(array: T[]): T[];
|
|
5
11
|
export declare function arrayEmpty<T>(array: T[]): void;
|
|
6
12
|
/** Helper function for determining if two arrays contain the exact same elements. */
|
package/dist/functions/array.lua
CHANGED
|
@@ -27,19 +27,15 @@ function ____exports.getRandomArrayIndex(self, array, seed)
|
|
|
27
27
|
local randomIndex = getRandomInt(nil, 0, #array - 1, seed)
|
|
28
28
|
return randomIndex
|
|
29
29
|
end
|
|
30
|
-
function ____exports.arrayCombine(self,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
)
|
|
42
|
-
}
|
|
30
|
+
function ____exports.arrayCombine(self, ...)
|
|
31
|
+
local arrays = {...}
|
|
32
|
+
local elements = {}
|
|
33
|
+
for ____, array in ipairs(arrays) do
|
|
34
|
+
for ____, element in ipairs(array) do
|
|
35
|
+
__TS__ArrayPush(elements, element)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
return elements
|
|
43
39
|
end
|
|
44
40
|
function ____exports.arrayCopy(self, array)
|
|
45
41
|
return {
|