isaacscript-common 1.2.47 → 1.2.48
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.
|
@@ -9,7 +9,7 @@ local ____deepCopy = require("functions.deepCopy")
|
|
|
9
9
|
local deepCopy = ____deepCopy.deepCopy
|
|
10
10
|
local SerializationType = ____deepCopy.SerializationType
|
|
11
11
|
local ____table = require("functions.table")
|
|
12
|
-
local
|
|
12
|
+
local clearTable = ____table.clearTable
|
|
13
13
|
local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
|
|
14
14
|
local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
|
|
15
15
|
local ____SaveData = require("types.SaveData")
|
|
@@ -85,7 +85,7 @@ function restoreDefaults(self, childTableName)
|
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
87
|
function clearAndCopyAllElements(self, oldTable, newTable)
|
|
88
|
-
|
|
88
|
+
clearTable(nil, oldTable)
|
|
89
89
|
for key, value in pairs(newTable) do
|
|
90
90
|
oldTable[key] = value
|
|
91
91
|
end
|
|
@@ -21,7 +21,7 @@ local SerializationType = ____deepCopy.SerializationType
|
|
|
21
21
|
local ____log = require("functions.log")
|
|
22
22
|
local log = ____log.log
|
|
23
23
|
local ____table = require("functions.table")
|
|
24
|
-
local
|
|
24
|
+
local clearTable = ____table.clearTable
|
|
25
25
|
function ____exports.merge(self, oldObject, newTable, traversalDescription)
|
|
26
26
|
local oldObjectType = type(oldObject)
|
|
27
27
|
if oldObjectType ~= "table" then
|
|
@@ -48,7 +48,7 @@ function mergeArray(self, oldObject, newTable)
|
|
|
48
48
|
if not isArray(nil, oldArray) or not isArray(nil, newTable) then
|
|
49
49
|
return false
|
|
50
50
|
end
|
|
51
|
-
|
|
51
|
+
clearTable(nil, oldArray)
|
|
52
52
|
for key, value in pairs(newTable) do
|
|
53
53
|
oldArray[key] = value
|
|
54
54
|
end
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* In a Map, you can use the `clear` method to delete every element. However, in a LuaTable, the
|
|
4
4
|
* `clear` method does not exist. Use this helper function as a drop-in replacement for this.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function clearTable(table: LuaTable): void;
|
package/dist/functions/table.lua
CHANGED