isaacscript-common 6.6.3 → 6.7.0

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.
Files changed (262) hide show
  1. package/dist/callbacks/customRevive.lua +4 -4
  2. package/dist/callbacks/postCursedTeleport.lua +2 -2
  3. package/dist/callbacks/postCustomDoorEnter.d.ts +1 -1
  4. package/dist/callbacks/postCustomDoorEnter.lua +6 -6
  5. package/dist/callbacks/postDiceRoomActivated.lua +2 -2
  6. package/dist/callbacks/postFlip.lua +3 -3
  7. package/dist/callbacks/postGridEntity.lua +3 -3
  8. package/dist/callbacks/postGridEntityCollision.lua +3 -3
  9. package/dist/callbacks/postGridEntityRender.lua +2 -2
  10. package/dist/callbacks/postNewRoomEarly.lua +5 -5
  11. package/dist/callbacks/postPickupCollect.lua +2 -2
  12. package/dist/callbacks/postPitRender.lua +2 -2
  13. package/dist/callbacks/postPitUpdate.lua +2 -2
  14. package/dist/callbacks/postPlayerCollectible.lua +2 -2
  15. package/dist/callbacks/postPoopRender.lua +2 -2
  16. package/dist/callbacks/postPoopUpdate.lua +2 -2
  17. package/dist/callbacks/postPressurePlateRender.lua +2 -2
  18. package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
  19. package/dist/callbacks/postPurchase.lua +2 -2
  20. package/dist/callbacks/postRockRender.lua +2 -2
  21. package/dist/callbacks/postRockUpdate.lua +2 -2
  22. package/dist/callbacks/postSlotInitUpdate.lua +2 -2
  23. package/dist/callbacks/postSlotRender.lua +2 -2
  24. package/dist/callbacks/postSpikesRender.lua +2 -2
  25. package/dist/callbacks/postSpikesUpdate.lua +2 -2
  26. package/dist/callbacks/postTNTRender.lua +2 -2
  27. package/dist/callbacks/postTNTUpdate.lua +2 -2
  28. package/dist/callbacks/preBerserkDeath.lua +2 -2
  29. package/dist/callbacks/preNewLevel.lua +2 -2
  30. package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
  31. package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
  32. package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
  33. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
  34. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
  35. package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
  36. package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
  37. package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
  38. package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
  39. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
  40. package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
  41. package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
  42. package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
  43. package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
  44. package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
  45. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
  46. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
  47. package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
  48. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
  49. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
  50. package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
  51. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
  52. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
  53. package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
  54. package/dist/enums/private/SerializationBrand.d.ts +0 -4
  55. package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
  56. package/dist/features/characterStats.lua +2 -2
  57. package/dist/features/collectibleItemPoolType.lua +2 -2
  58. package/dist/features/customGridEntity.d.ts.map +1 -1
  59. package/dist/features/customGridEntity.lua +5 -5
  60. package/dist/features/customStage/backdrop.lua +2 -2
  61. package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
  62. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
  63. package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
  64. package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
  65. package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
  66. package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
  67. package/dist/features/customStage/exports.lua +4 -4
  68. package/dist/features/customStage/init.lua +6 -6
  69. package/dist/features/customStage/shadows.lua +2 -2
  70. package/dist/features/customStage/versusScreen.lua +4 -4
  71. package/dist/features/debugDisplay/v.lua +4 -4
  72. package/dist/features/deployJSONRoom.lua +20 -20
  73. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  74. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  75. package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
  76. package/dist/features/pause.lua +2 -2
  77. package/dist/features/persistentEntities.lua +2 -2
  78. package/dist/features/preventCollectibleRotation.lua +2 -2
  79. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  80. package/dist/features/saveDataManager/merge.lua +4 -3
  81. package/dist/features/sirenHelpers.lua +2 -2
  82. package/dist/functions/ambush.lua +5 -5
  83. package/dist/functions/array.d.ts.map +1 -1
  84. package/dist/functions/array.lua +1 -1
  85. package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
  86. package/dist/functions/bosses.d.ts.map +1 -0
  87. package/dist/functions/{boss.lua → bosses.lua} +38 -13
  88. package/dist/functions/collectibleTag.lua +2 -2
  89. package/dist/functions/collectibles.lua +5 -5
  90. package/dist/functions/deepCopy.d.ts +8 -5
  91. package/dist/functions/deepCopy.d.ts.map +1 -1
  92. package/dist/functions/deepCopy.lua +142 -38
  93. package/dist/functions/deepCopyTests.d.ts +6 -1
  94. package/dist/functions/deepCopyTests.d.ts.map +1 -1
  95. package/dist/functions/deepCopyTests.lua +19 -16
  96. package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
  97. package/dist/functions/entities.d.ts.map +1 -0
  98. package/dist/functions/{entity.lua → entities.lua} +25 -20
  99. package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
  100. package/dist/functions/entitiesSpecific.d.ts.map +1 -0
  101. package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
  102. package/dist/functions/familiars.lua +2 -2
  103. package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
  104. package/dist/functions/gridEntities.d.ts.map +1 -0
  105. package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
  106. package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
  107. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
  108. package/dist/functions/gridEntitiesSpecific.lua +366 -0
  109. package/dist/functions/log.d.ts +1 -1
  110. package/dist/functions/log.d.ts.map +1 -1
  111. package/dist/functions/log.lua +16 -12
  112. package/dist/functions/mergeTests.d.ts +7 -1
  113. package/dist/functions/mergeTests.d.ts.map +1 -1
  114. package/dist/functions/mergeTests.lua +86 -7
  115. package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
  116. package/dist/functions/npcs.d.ts.map +1 -0
  117. package/dist/functions/{npc.lua → npcs.lua} +44 -9
  118. package/dist/functions/pickups.d.ts +4 -119
  119. package/dist/functions/pickups.d.ts.map +1 -1
  120. package/dist/functions/pickups.lua +10 -439
  121. package/dist/functions/pickupsSpecific.d.ts +229 -0
  122. package/dist/functions/pickupsSpecific.d.ts.map +1 -0
  123. package/dist/functions/pickupsSpecific.lua +560 -0
  124. package/dist/functions/playerHealth.lua +6 -6
  125. package/dist/functions/{player.d.ts → players.d.ts} +1 -1
  126. package/dist/functions/players.d.ts.map +1 -0
  127. package/dist/functions/{player.lua → players.lua} +0 -0
  128. package/dist/functions/pocketItems.lua +2 -2
  129. package/dist/functions/positionVelocity.lua +6 -6
  130. package/dist/functions/pressurePlate.d.ts +10 -0
  131. package/dist/functions/pressurePlate.d.ts.map +1 -0
  132. package/dist/functions/pressurePlate.lua +29 -0
  133. package/dist/functions/revive.lua +7 -7
  134. package/dist/functions/rooms.lua +2 -2
  135. package/dist/functions/saveFile.lua +3 -3
  136. package/dist/functions/spawnCollectible.lua +4 -4
  137. package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
  138. package/dist/functions/sprites.d.ts.map +1 -0
  139. package/dist/functions/{sprite.lua → sprites.lua} +0 -0
  140. package/dist/functions/table.d.ts +1 -1
  141. package/dist/functions/table.lua +1 -1
  142. package/dist/functions/transformations.lua +2 -2
  143. package/dist/functions/trinketGive.lua +2 -2
  144. package/dist/functions/trinkets.lua +6 -6
  145. package/dist/functions/utils.d.ts +7 -0
  146. package/dist/functions/utils.d.ts.map +1 -1
  147. package/dist/functions/utils.lua +35 -22
  148. package/dist/index.d.ts +10 -8
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.lua +26 -10
  151. package/dist/types/AnyGridEntity.d.ts +10 -0
  152. package/dist/types/AnyGridEntity.d.ts.map +1 -0
  153. package/dist/types/AnyGridEntity.lua +2 -0
  154. package/package.json +2 -2
  155. package/src/callbacks/customRevive.ts +2 -2
  156. package/src/callbacks/postCursedTeleport.ts +2 -2
  157. package/src/callbacks/postCustomDoorEnter.ts +3 -3
  158. package/src/callbacks/postDiceRoomActivated.ts +1 -1
  159. package/src/callbacks/postFlip.ts +1 -1
  160. package/src/callbacks/postGridEntity.ts +1 -1
  161. package/src/callbacks/postGridEntityCollision.ts +1 -1
  162. package/src/callbacks/postGridEntityRender.ts +1 -1
  163. package/src/callbacks/postNewRoomEarly.ts +9 -3
  164. package/src/callbacks/postPickupCollect.ts +1 -1
  165. package/src/callbacks/postPitRender.ts +1 -1
  166. package/src/callbacks/postPitUpdate.ts +1 -1
  167. package/src/callbacks/postPlayerCollectible.ts +2 -2
  168. package/src/callbacks/postPoopRender.ts +1 -1
  169. package/src/callbacks/postPoopUpdate.ts +1 -1
  170. package/src/callbacks/postPressurePlateRender.ts +1 -1
  171. package/src/callbacks/postPressurePlateUpdate.ts +1 -1
  172. package/src/callbacks/postPurchase.ts +1 -1
  173. package/src/callbacks/postRockRender.ts +1 -1
  174. package/src/callbacks/postRockUpdate.ts +1 -1
  175. package/src/callbacks/postSacrifice.ts +1 -1
  176. package/src/callbacks/postSlotInitUpdate.ts +1 -1
  177. package/src/callbacks/postSlotRender.ts +1 -1
  178. package/src/callbacks/postSpikesRender.ts +1 -1
  179. package/src/callbacks/postSpikesUpdate.ts +1 -1
  180. package/src/callbacks/postTNTRender.ts +1 -1
  181. package/src/callbacks/postTNTUpdate.ts +1 -1
  182. package/src/callbacks/preBerserkDeath.ts +1 -1
  183. package/src/callbacks/preNewLevel.ts +1 -1
  184. package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
  185. package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
  186. package/src/callbacks/subscriptions/postPitRender.ts +6 -7
  187. package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
  188. package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
  189. package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
  190. package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
  191. package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
  192. package/src/enums/private/SerializationBrand.ts +0 -4
  193. package/src/features/characterStats.ts +1 -1
  194. package/src/features/collectibleItemPoolType.ts +1 -1
  195. package/src/features/customGridEntity.ts +6 -3
  196. package/src/features/customStage/backdrop.ts +1 -1
  197. package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
  198. package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
  199. package/src/features/customStage/exports.ts +2 -2
  200. package/src/features/customStage/init.ts +1 -1
  201. package/src/features/customStage/shadows.ts +1 -1
  202. package/src/features/customStage/versusScreen.ts +2 -2
  203. package/src/features/debugDisplay/v.ts +2 -2
  204. package/src/features/deployJSONRoom.ts +11 -7
  205. package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
  206. package/src/features/extraConsoleCommands/listCommands.ts +13 -9
  207. package/src/features/pause.ts +1 -1
  208. package/src/features/persistentEntities.ts +2 -2
  209. package/src/features/preventCollectibleRotation.ts +1 -1
  210. package/src/features/saveDataManager/exports.ts +7 -4
  211. package/src/features/saveDataManager/merge.ts +3 -3
  212. package/src/features/sirenHelpers.ts +1 -1
  213. package/src/functions/ambush.ts +2 -2
  214. package/src/functions/array.ts +5 -2
  215. package/src/functions/bitwise.ts +2 -2
  216. package/src/functions/{boss.ts → bosses.ts} +29 -21
  217. package/src/functions/collectibleTag.ts +1 -1
  218. package/src/functions/collectibles.ts +2 -2
  219. package/src/functions/deepCopy.ts +98 -19
  220. package/src/functions/deepCopyTests.ts +75 -19
  221. package/src/functions/{entity.ts → entities.ts} +23 -21
  222. package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
  223. package/src/functions/familiars.ts +1 -1
  224. package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
  225. package/src/functions/gridEntitiesSpecific.ts +490 -0
  226. package/src/functions/log.ts +19 -10
  227. package/src/functions/mergeTests.ts +152 -4
  228. package/src/functions/{npc.ts → npcs.ts} +42 -11
  229. package/src/functions/pickups.ts +8 -475
  230. package/src/functions/pickupsSpecific.ts +613 -0
  231. package/src/functions/playerHealth.ts +1 -1
  232. package/src/functions/{player.ts → players.ts} +0 -0
  233. package/src/functions/pocketItems.ts +1 -1
  234. package/src/functions/positionVelocity.ts +3 -3
  235. package/src/functions/pressurePlate.ts +29 -0
  236. package/src/functions/revive.ts +2 -2
  237. package/src/functions/rooms.ts +1 -1
  238. package/src/functions/saveFile.ts +1 -1
  239. package/src/functions/spawnCollectible.ts +2 -2
  240. package/src/functions/{sprite.ts → sprites.ts} +0 -0
  241. package/src/functions/table.ts +1 -1
  242. package/src/functions/transformations.ts +1 -1
  243. package/src/functions/trinketGive.ts +4 -4
  244. package/src/functions/trinkets.ts +3 -3
  245. package/src/functions/tstlClass.ts +1 -1
  246. package/src/functions/ui.ts +3 -3
  247. package/src/functions/utils.ts +32 -13
  248. package/src/index.ts +10 -8
  249. package/src/types/AnyGridEntity.ts +9 -0
  250. package/dist/features/customStage/gridEntities.d.ts.map +0 -1
  251. package/dist/features/customStage/util.d.ts.map +0 -1
  252. package/dist/functions/boss.d.ts.map +0 -1
  253. package/dist/functions/entity.d.ts.map +0 -1
  254. package/dist/functions/entitySpecific.d.ts.map +0 -1
  255. package/dist/functions/gridEntity.d.ts.map +0 -1
  256. package/dist/functions/gridEntitySpecific.d.ts +0 -29
  257. package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
  258. package/dist/functions/gridEntitySpecific.lua +0 -114
  259. package/dist/functions/npc.d.ts.map +0 -1
  260. package/dist/functions/player.d.ts.map +0 -1
  261. package/dist/functions/sprite.d.ts.map +0 -1
  262. package/src/functions/gridEntitySpecific.ts +0 -143
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":";;;AAKA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,GACzB,OAAO,CAST;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;;G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G,CAAC,EAAE,CAO5D;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,OAAO,EAAE,CAoC5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAavD;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,CAAC,EAC9B,YAAY,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAChC,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,GACrC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,CAAC,EAAE,CAKL;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,IAAI,CAWN;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM3E"}
@@ -437,7 +437,7 @@ function ____exports.isArray(self, object)
437
437
  if not hasAllNumberKeys then
438
438
  return false
439
439
  end
440
- local tableLength = #object
440
+ local tableLength = #__TS__ObjectKeys(object)
441
441
  if tableLength == 0 then
442
442
  return true
443
443
  end
@@ -4,8 +4,16 @@ import { EntityType, StageType } from "isaac-typescript-definitions";
4
4
  *
5
5
  * This function will not include bosses on an internal blacklist, such as Death's scythes or Big
6
6
  * Horn holes.
7
+ *
8
+ * @param entityType Optional. If specified, will only get the bosses that match the type. Default
9
+ * is -1, which matches every type.
10
+ * @param variant Optional. If specified, will only get the bosses that match the variant. Default
11
+ * is -1, which matches every variant.
12
+ * @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
13
+ * is -1, which matches every sub-type.
14
+ * @param ignoreFriendly Optional. Default is false.
7
15
  */
8
- export declare function getAliveBosses(matchingEntityType?: EntityType, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
16
+ export declare function getAliveBosses(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): EntityNPC[];
9
17
  /**
10
18
  * Helper function to get the set of every boss in the game.
11
19
  *
@@ -23,8 +31,18 @@ export declare function getAllBossesSet(): Set<string>;
23
31
  * Also see the `getAllBossesSet` and `getCombinedBossSet` functions.
24
32
  */
25
33
  export declare function getBossSet(stage: int, stageType: StageType): ReadonlySet<string> | undefined;
26
- /** Helper function to get all of the bosses in the room. */
27
- export declare function getBosses(matchingEntityType?: EntityType, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
34
+ /**
35
+ * Helper function to get all of the bosses in the room.
36
+ *
37
+ * @param entityType Optional. If specified, will only get the bosses that match the type. Default
38
+ * is -1, which matches every type.
39
+ * @param variant Optional. If specified, will only get the bosses that match the variant. Default
40
+ * is -1, which matches every variant.
41
+ * @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
42
+ * is -1, which matches every sub-type.
43
+ * @param ignoreFriendly Optional. Default is false.
44
+ */
45
+ export declare function getBosses(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): EntityNPC[];
28
46
  /**
29
47
  * Helper function to get the set of vanilla bosses for a particular stage across all of the stage
30
48
  * types. For example, specifying a stage of 2 will return a set with all of the bosses for
@@ -54,4 +72,4 @@ export declare function spawnBoss(entityType: EntityType, variant: int, subType:
54
72
  * For more information, see the documentation for the `spawnBoss` function.
55
73
  */
56
74
  export declare function spawnBossWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined, numSegments?: int): EntityNPC;
57
- //# sourceMappingURL=boss.d.ts.map
75
+ //# sourceMappingURL=bosses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAwBtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,GAAG,CAAC,MAAM,CAAC,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAOtE;AAED,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAyBX;AAmCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
@@ -15,11 +15,11 @@ local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_M
15
15
  local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
16
16
  local ____sinEntityTypesSet = require("sets.sinEntityTypesSet")
17
17
  local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
18
- local ____entitySpecific = require("functions.entitySpecific")
19
- local getNPCs = ____entitySpecific.getNPCs
20
- local spawnNPC = ____entitySpecific.spawnNPC
21
- local ____npc = require("functions.npc")
22
- local getAliveNPCs = ____npc.getAliveNPCs
18
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
19
+ local getNPCs = ____entitiesSpecific.getNPCs
20
+ local spawnNPC = ____entitiesSpecific.spawnNPC
21
+ local ____npcs = require("functions.npcs")
22
+ local getAliveNPCs = ____npcs.getAliveNPCs
23
23
  local ____rng = require("functions.rng")
24
24
  local isRNG = ____rng.isRNG
25
25
  local ____set = require("functions.set")
@@ -69,15 +69,32 @@ DEFAULT_BOSS_MULTI_SEGMENTS = 4
69
69
  --
70
70
  -- This function will not include bosses on an internal blacklist, such as Death's scythes or Big
71
71
  -- Horn holes.
72
- function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
72
+ --
73
+ -- @param entityType Optional. If specified, will only get the bosses that match the type. Default
74
+ -- is -1, which matches every type.
75
+ -- @param variant Optional. If specified, will only get the bosses that match the variant. Default
76
+ -- is -1, which matches every variant.
77
+ -- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
78
+ -- is -1, which matches every sub-type.
79
+ -- @param ignoreFriendly Optional. Default is false.
80
+ function ____exports.getAliveBosses(self, entityType, variant, subType, ignoreFriendly)
81
+ if entityType == nil then
82
+ entityType = -1
83
+ end
84
+ if variant == nil then
85
+ variant = -1
86
+ end
87
+ if subType == nil then
88
+ subType = -1
89
+ end
73
90
  if ignoreFriendly == nil then
74
91
  ignoreFriendly = false
75
92
  end
76
93
  local aliveNPCs = getAliveNPCs(
77
94
  nil,
78
- matchingEntityType,
79
- matchingVariant,
80
- matchingSubType,
95
+ entityType,
96
+ variant,
97
+ subType,
81
98
  ignoreFriendly
82
99
  )
83
100
  return __TS__ArrayFilter(
@@ -111,15 +128,23 @@ function ____exports.getBossSet(self, stage, stageType)
111
128
  return copySet(nil, bossSet)
112
129
  end
113
130
  --- Helper function to get all of the bosses in the room.
114
- function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
131
+ --
132
+ -- @param entityType Optional. If specified, will only get the bosses that match the type. Default
133
+ -- is -1, which matches every type.
134
+ -- @param variant Optional. If specified, will only get the bosses that match the variant. Default
135
+ -- is -1, which matches every variant.
136
+ -- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
137
+ -- is -1, which matches every sub-type.
138
+ -- @param ignoreFriendly Optional. Default is false.
139
+ function ____exports.getBosses(self, entityType, variant, subType, ignoreFriendly)
115
140
  if ignoreFriendly == nil then
116
141
  ignoreFriendly = false
117
142
  end
118
143
  local npcs = getNPCs(
119
144
  nil,
120
- matchingEntityType,
121
- matchingVariant,
122
- matchingSubType,
145
+ entityType,
146
+ variant,
147
+ subType,
123
148
  ignoreFriendly
124
149
  )
125
150
  return __TS__ArrayFilter(
@@ -14,8 +14,8 @@ local ____enums = require("functions.enums")
14
14
  local getEnumValues = ____enums.getEnumValues
15
15
  local ____flag = require("functions.flag")
16
16
  local getFlagName = ____flag.getFlagName
17
- local ____player = require("functions.player")
18
- local getPlayerCollectibleCount = ____player.getPlayerCollectibleCount
17
+ local ____players = require("functions.players")
18
+ local getPlayerCollectibleCount = ____players.getPlayerCollectibleCount
19
19
  local ____set = require("functions.set")
20
20
  local copySet = ____set.copySet
21
21
  function ____exports.collectibleHasTag(self, collectibleType, tag)
@@ -27,15 +27,15 @@ local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
27
27
  local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
28
28
  local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveCollectibleTypesSet")
29
29
  local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
30
- local ____entity = require("functions.entity")
31
- local getEntityID = ____entity.getEntityID
30
+ local ____entities = require("functions.entities")
31
+ local getEntityID = ____entities.getEntityID
32
32
  local ____pickupVariants = require("functions.pickupVariants")
33
33
  local isCollectible = ____pickupVariants.isCollectible
34
34
  local ____roomData = require("functions.roomData")
35
35
  local getRoomListIndex = ____roomData.getRoomListIndex
36
- local ____sprite = require("functions.sprite")
37
- local clearSprite = ____sprite.clearSprite
38
- local spriteEquals = ____sprite.spriteEquals
36
+ local ____sprites = require("functions.sprites")
37
+ local clearSprite = ____sprites.clearSprite
38
+ local spriteEquals = ____sprites.spriteEquals
39
39
  local ____utils = require("functions.utils")
40
40
  local irange = ____utils.irange
41
41
  function initQuestionMarkSprite(self)
@@ -21,10 +21,13 @@ import { SerializationType } from "../enums/SerializationType";
21
21
  * - other Isaac API objects such as `EntityPtr` (that have a type of "userdata")
22
22
  *
23
23
  * @param value The primitive or object to copy.
24
- * @param serializationType Has 3 possible values. Can leave objects as-is, or can serialize objects
25
- * to Lua tables, or can deserialize Lua tables to objects. Default is
26
- * `SerializationType.NONE`.
27
- * @param traversalDescription Used to track the current key that we are operating on.
24
+ * @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
25
+ * serialize objects to Lua tables, or can deserialize Lua tables to
26
+ * objects. Default is `SerializationType.NONE`.
27
+ * @param traversalDescription Optional. Used to track the current key that we are operating on.
28
+ * Default is an empty string.
29
+ * @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
30
+ * recursively copying a TSTL Map. Default is false.
28
31
  */
29
- export declare function deepCopy(value: unknown, serializationType?: SerializationType, traversalDescription?: string): unknown;
32
+ export declare function deepCopy(value: unknown, serializationType?: SerializationType, traversalDescription?: string, insideMap?: boolean): unknown;
30
33
  //# sourceMappingURL=deepCopy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA4B/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,oBAAyB,EAC1C,oBAAoB,SAAK,GACxB,OAAO,CA6CT"}
1
+ {"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA4B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,oBAAyB,EAC1C,oBAAoB,SAAK,EACzB,SAAS,UAAQ,GAChB,OAAO,CAkDT"}
@@ -66,17 +66,23 @@ local twoDimensionalSort = ____utils.twoDimensionalSort
66
66
  -- - other Isaac API objects such as `EntityPtr` (that have a type of "userdata")
67
67
  --
68
68
  -- @param value The primitive or object to copy.
69
- -- @param serializationType Has 3 possible values. Can leave objects as-is, or can serialize objects
70
- -- to Lua tables, or can deserialize Lua tables to objects. Default is
71
- -- `SerializationType.NONE`.
72
- -- @param traversalDescription Used to track the current key that we are operating on.
73
- function ____exports.deepCopy(self, value, serializationType, traversalDescription)
69
+ -- @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
70
+ -- serialize objects to Lua tables, or can deserialize Lua tables to
71
+ -- objects. Default is `SerializationType.NONE`.
72
+ -- @param traversalDescription Optional. Used to track the current key that we are operating on.
73
+ -- Default is an empty string.
74
+ -- @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
75
+ -- recursively copying a TSTL Map. Default is false.
76
+ function ____exports.deepCopy(self, value, serializationType, traversalDescription, insideMap)
74
77
  if serializationType == nil then
75
78
  serializationType = SerializationType.NONE
76
79
  end
77
80
  if traversalDescription == nil then
78
81
  traversalDescription = ""
79
82
  end
83
+ if insideMap == nil then
84
+ insideMap = false
85
+ end
80
86
  if SAVE_DATA_MANAGER_DEBUG then
81
87
  local logString = "deepCopy is operating on: " .. traversalDescription
82
88
  if serializationType == SerializationType.SERIALIZE then
@@ -109,7 +115,13 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
109
115
  if ____cond6 then
110
116
  do
111
117
  local luaTable = value
112
- return deepCopyTable(nil, luaTable, serializationType, traversalDescription)
118
+ return deepCopyTable(
119
+ nil,
120
+ luaTable,
121
+ serializationType,
122
+ traversalDescription,
123
+ insideMap
124
+ )
113
125
  end
114
126
  end
115
127
  ____cond6 = ____cond6 or ____switch6 == "userdata"
@@ -120,15 +132,33 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
120
132
  end
121
133
  until true
122
134
  end
123
- function deepCopyTable(self, luaTable, serializationType, traversalDescription)
135
+ function deepCopyTable(self, luaTable, serializationType, traversalDescription, insideMap)
124
136
  if isDefaultMap(nil, luaTable) or luaTable[SerializationBrand.DEFAULT_MAP] ~= nil then
125
- return deepCopyDefaultMap(nil, luaTable, serializationType, traversalDescription)
137
+ return deepCopyDefaultMap(
138
+ nil,
139
+ luaTable,
140
+ serializationType,
141
+ traversalDescription,
142
+ insideMap
143
+ )
126
144
  end
127
145
  if isTSTLMap(nil, luaTable) or luaTable[SerializationBrand.MAP] ~= nil then
128
- return deepCopyMap(nil, luaTable, serializationType, traversalDescription)
146
+ return deepCopyMap(
147
+ nil,
148
+ luaTable,
149
+ serializationType,
150
+ traversalDescription,
151
+ insideMap
152
+ )
129
153
  end
130
154
  if isTSTLSet(nil, luaTable) or luaTable[SerializationBrand.SET] ~= nil then
131
- return deepCopySet(nil, luaTable, serializationType, traversalDescription)
155
+ return deepCopySet(
156
+ nil,
157
+ luaTable,
158
+ serializationType,
159
+ traversalDescription,
160
+ insideMap
161
+ )
132
162
  end
133
163
  local className = getTSTLClassName(nil, luaTable)
134
164
  if className == "WeakMap" then
@@ -138,18 +168,36 @@ function deepCopyTable(self, luaTable, serializationType, traversalDescription)
138
168
  error("The deep copy function does not support copying the \"WeakSet\" class for: " .. traversalDescription)
139
169
  end
140
170
  if isUserDefinedTSTLClass(nil, luaTable) then
141
- return deepCopyTSTLClass(nil, luaTable, serializationType, traversalDescription)
171
+ return deepCopyTSTLClass(
172
+ nil,
173
+ luaTable,
174
+ serializationType,
175
+ traversalDescription,
176
+ insideMap
177
+ )
142
178
  end
143
179
  checkMetatable(nil, luaTable, traversalDescription)
144
180
  if isSerializedIsaacAPIClass(nil, luaTable) and serializationType == SerializationType.DESERIALIZE then
145
181
  return deserializeIsaacAPIClass(nil, luaTable)
146
182
  end
147
183
  if isArray(nil, luaTable) then
148
- return deepCopyArray(nil, luaTable, serializationType, traversalDescription)
149
- end
150
- return deepCopyNormalLuaTable(nil, luaTable, serializationType, traversalDescription)
184
+ return deepCopyArray(
185
+ nil,
186
+ luaTable,
187
+ serializationType,
188
+ traversalDescription,
189
+ insideMap
190
+ )
191
+ end
192
+ return deepCopyNormalLuaTable(
193
+ nil,
194
+ luaTable,
195
+ serializationType,
196
+ traversalDescription,
197
+ insideMap
198
+ )
151
199
  end
152
- function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription)
200
+ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription, insideMap)
153
201
  local ____isDefaultMap_result_0
154
202
  if isDefaultMap(nil, defaultMap) then
155
203
  ____isDefaultMap_result_0 = defaultMap:getConstructorArg()
@@ -158,7 +206,17 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
158
206
  end
159
207
  local constructorArg = ____isDefaultMap_result_0
160
208
  if serializationType == SerializationType.SERIALIZE and not isPrimitive(nil, constructorArg) then
161
- return deepCopyMap(nil, defaultMap, serializationType, traversalDescription)
209
+ if insideMap then
210
+ error("Failed to deep copy a DefaultMap because it was instantiated with a factory function and was also inside of another map. You cannot use a nested DefaultMap in this way because factory functions are not serializable. (In other words, there is no way to copy the function that you are using for the DefaultMap into the \"save#.dat\" file.) Instead, refactor your data structure so that the DefaultMap is not nested.")
211
+ else
212
+ return deepCopyMap(
213
+ nil,
214
+ defaultMap,
215
+ serializationType,
216
+ traversalDescription,
217
+ insideMap
218
+ )
219
+ end
162
220
  end
163
221
  local newDefaultMap = getNewDefaultMap(
164
222
  nil,
@@ -167,7 +225,14 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
167
225
  traversalDescription,
168
226
  constructorArg
169
227
  )
170
- local ____getCopiedEntries_result_1 = getCopiedEntries(nil, defaultMap, serializationType, traversalDescription)
228
+ insideMap = true
229
+ local ____getCopiedEntries_result_1 = getCopiedEntries(
230
+ nil,
231
+ defaultMap,
232
+ serializationType,
233
+ traversalDescription,
234
+ insideMap
235
+ )
171
236
  local entries = ____getCopiedEntries_result_1.entries
172
237
  local convertedNumberKeysToStrings = ____getCopiedEntries_result_1.convertedNumberKeysToStrings
173
238
  if convertedNumberKeysToStrings then
@@ -186,19 +251,20 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
186
251
  newDefaultMap[key] = value
187
252
  end
188
253
  end
254
+ insideMap = false
189
255
  return newDefaultMap
190
256
  end
191
257
  function getNewDefaultMap(self, defaultMap, serializationType, traversalDescription, constructorArg)
192
258
  repeat
193
- local ____switch31 = serializationType
194
- local ____cond31 = ____switch31 == SerializationType.NONE
195
- if ____cond31 then
259
+ local ____switch33 = serializationType
260
+ local ____cond33 = ____switch33 == SerializationType.NONE
261
+ if ____cond33 then
196
262
  do
197
263
  return __TS__New(DefaultMap, constructorArg)
198
264
  end
199
265
  end
200
- ____cond31 = ____cond31 or ____switch31 == SerializationType.SERIALIZE
201
- if ____cond31 then
266
+ ____cond33 = ____cond33 or ____switch33 == SerializationType.SERIALIZE
267
+ if ____cond33 then
202
268
  do
203
269
  local newDefaultMap = {}
204
270
  newDefaultMap[SerializationBrand.DEFAULT_MAP] = ""
@@ -206,8 +272,8 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
206
272
  return newDefaultMap
207
273
  end
208
274
  end
209
- ____cond31 = ____cond31 or ____switch31 == SerializationType.DESERIALIZE
210
- if ____cond31 then
275
+ ____cond33 = ____cond33 or ____switch33 == SerializationType.DESERIALIZE
276
+ if ____cond33 then
211
277
  do
212
278
  if isDefaultMap(nil, defaultMap) then
213
279
  error(("The deep copy function failed to deserialize a default map of \"" .. traversalDescription) .. "\", since it was not a Lua table.")
@@ -221,7 +287,7 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
221
287
  end
222
288
  until true
223
289
  end
224
- function deepCopyMap(self, map, serializationType, traversalDescription)
290
+ function deepCopyMap(self, map, serializationType, traversalDescription, insideMap)
225
291
  local newMap
226
292
  if serializationType == SerializationType.SERIALIZE then
227
293
  newMap = {}
@@ -229,7 +295,14 @@ function deepCopyMap(self, map, serializationType, traversalDescription)
229
295
  else
230
296
  newMap = __TS__New(Map)
231
297
  end
232
- local ____getCopiedEntries_result_2 = getCopiedEntries(nil, map, serializationType, traversalDescription)
298
+ insideMap = true
299
+ local ____getCopiedEntries_result_2 = getCopiedEntries(
300
+ nil,
301
+ map,
302
+ serializationType,
303
+ traversalDescription,
304
+ insideMap
305
+ )
233
306
  local entries = ____getCopiedEntries_result_2.entries
234
307
  local convertedNumberKeysToStrings = ____getCopiedEntries_result_2.convertedNumberKeysToStrings
235
308
  if convertedNumberKeysToStrings then
@@ -248,9 +321,10 @@ function deepCopyMap(self, map, serializationType, traversalDescription)
248
321
  newMap[key] = value
249
322
  end
250
323
  end
324
+ insideMap = false
251
325
  return newMap
252
326
  end
253
- function deepCopySet(self, set, serializationType, traversalDescription)
327
+ function deepCopySet(self, set, serializationType, traversalDescription, insideMap)
254
328
  local newSet
255
329
  if serializationType == SerializationType.SERIALIZE then
256
330
  newSet = {}
@@ -258,7 +332,13 @@ function deepCopySet(self, set, serializationType, traversalDescription)
258
332
  else
259
333
  newSet = __TS__New(Set)
260
334
  end
261
- local ____getCopiedEntries_result_3 = getCopiedEntries(nil, set, serializationType, traversalDescription)
335
+ local ____getCopiedEntries_result_3 = getCopiedEntries(
336
+ nil,
337
+ set,
338
+ serializationType,
339
+ traversalDescription,
340
+ insideMap
341
+ )
262
342
  local entries = ____getCopiedEntries_result_3.entries
263
343
  local convertedNumberKeysToStrings = ____getCopiedEntries_result_3.convertedNumberKeysToStrings
264
344
  if convertedNumberKeysToStrings then
@@ -278,14 +358,20 @@ function deepCopySet(self, set, serializationType, traversalDescription)
278
358
  end
279
359
  return newSet
280
360
  end
281
- function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription)
361
+ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription, insideMap)
282
362
  local newClass
283
363
  if serializationType == SerializationType.SERIALIZE then
284
364
  newClass = {}
285
365
  else
286
366
  newClass = newTSTLClass(nil, tstlClass)
287
367
  end
288
- local ____getCopiedEntries_result_4 = getCopiedEntries(nil, tstlClass, serializationType, traversalDescription)
368
+ local ____getCopiedEntries_result_4 = getCopiedEntries(
369
+ nil,
370
+ tstlClass,
371
+ serializationType,
372
+ traversalDescription,
373
+ insideMap
374
+ )
289
375
  local entries = ____getCopiedEntries_result_4.entries
290
376
  local convertedNumberKeysToStrings = ____getCopiedEntries_result_4.convertedNumberKeysToStrings
291
377
  if convertedNumberKeysToStrings then
@@ -298,17 +384,29 @@ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescript
298
384
  end
299
385
  return newClass
300
386
  end
301
- function deepCopyArray(self, array, serializationType, traversalDescription)
387
+ function deepCopyArray(self, array, serializationType, traversalDescription, insideMap)
302
388
  local newArray = {}
303
389
  for ____, value in ipairs(array) do
304
- local newValue = ____exports.deepCopy(nil, value, serializationType, traversalDescription)
390
+ local newValue = ____exports.deepCopy(
391
+ nil,
392
+ value,
393
+ serializationType,
394
+ traversalDescription,
395
+ insideMap
396
+ )
305
397
  newArray[#newArray + 1] = newValue
306
398
  end
307
399
  return newArray
308
400
  end
309
- function deepCopyNormalLuaTable(self, luaTable, serializationType, traversalDescription)
401
+ function deepCopyNormalLuaTable(self, luaTable, serializationType, traversalDescription, insideMap)
310
402
  local newTable = {}
311
- local ____getCopiedEntries_result_5 = getCopiedEntries(nil, luaTable, serializationType, traversalDescription)
403
+ local ____getCopiedEntries_result_5 = getCopiedEntries(
404
+ nil,
405
+ luaTable,
406
+ serializationType,
407
+ traversalDescription,
408
+ insideMap
409
+ )
312
410
  local entries = ____getCopiedEntries_result_5.entries
313
411
  local convertedNumberKeysToStrings = ____getCopiedEntries_result_5.convertedNumberKeysToStrings
314
412
  if convertedNumberKeysToStrings then
@@ -321,7 +419,7 @@ function deepCopyNormalLuaTable(self, luaTable, serializationType, traversalDesc
321
419
  end
322
420
  return newTable
323
421
  end
324
- function getCopiedEntries(self, object, serializationType, traversalDescription)
422
+ function getCopiedEntries(self, object, serializationType, traversalDescription, insideMap)
325
423
  local entries = {}
326
424
  if isTSTLMap(nil, object) or isTSTLSet(nil, object) or isDefaultMap(nil, object) then
327
425
  for ____, ____value in __TS__Iterator(object:entries()) do
@@ -353,14 +451,20 @@ function getCopiedEntries(self, object, serializationType, traversalDescription)
353
451
  local value = ____value[2]
354
452
  do
355
453
  if isSerializationBrand(nil, key) then
356
- goto __continue78
454
+ goto __continue80
357
455
  end
358
456
  traversalDescription = getTraversalDescription(nil, key, traversalDescription)
359
- local newValue = ____exports.deepCopy(nil, value, serializationType, traversalDescription)
457
+ local newValue = ____exports.deepCopy(
458
+ nil,
459
+ value,
460
+ serializationType,
461
+ traversalDescription,
462
+ insideMap
463
+ )
360
464
  local keyToUse = convertNumberKeysToStrings and tostring(key) or key
361
465
  copiedEntries[#copiedEntries + 1] = {keyToUse, newValue}
362
466
  end
363
- ::__continue78::
467
+ ::__continue80::
364
468
  end
365
469
  return {entries = copiedEntries, convertedNumberKeysToStrings = convertNumberKeysToStrings}
366
470
  end
@@ -1,2 +1,7 @@
1
- export declare function deepCopyTests(): void;
1
+ /**
2
+ * Run the suite of tests that prove that the "deepCopy" helper function works properly.
3
+ *
4
+ * This function is only useful if you are troubleshooting the "deepCopy" function.
5
+ */
6
+ export declare function runDeepCopyTests(): void;
2
7
  //# sourceMappingURL=deepCopyTests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepCopyTests.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopyTests.ts"],"names":[],"mappings":"AASA,wBAAgB,aAAa,IAAI,IAAI,CAqBpC"}
1
+ {"version":3,"file":"deepCopyTests.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopyTests.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAqBvC"}