isaacscript-common 1.0.525 → 1.0.526

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,8 +1,13 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /// <reference types="typescript-to-lua/language-extensions" />
3
3
  /**
4
- * Using a Set constructor to copy a Set does not seem to work properly, so this helper function is
5
- * used instead.
4
+ * Using a Map constructor to copy a Map does not seem to work properly, so use this helper function
5
+ * instead.
6
+ */
7
+ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
8
+ /**
9
+ * Using a Set constructor to copy a Set does not seem to work properly, so use this helper function
10
+ * instead.
6
11
  */
7
12
  export declare function copySet<T>(oldSet: Set<T>): Set<T>;
8
13
  /**
@@ -2,6 +2,19 @@
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  local HEX_STRING_LENGTH = 6
5
+ function ____exports.copyMap(self, oldMap)
6
+ local newMap = __TS__New(Map)
7
+ for ____, ____value in __TS__Iterator(
8
+ oldMap:entries()
9
+ ) do
10
+ local key
11
+ key = ____value[1]
12
+ local value
13
+ value = ____value[2]
14
+ newMap:set(key, value)
15
+ end
16
+ return newMap
17
+ end
5
18
  function ____exports.copySet(self, oldSet)
6
19
  local newSet = __TS__New(Set)
7
20
  for ____, value in __TS__Iterator(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.525",
3
+ "version": "1.0.526",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",