isaacscript-common 87.4.0 → 87.5.1
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.
- package/README.md +1 -1
- package/dist/callbackClasses.d.ts +6 -6
- package/dist/callbackClasses.d.ts.map +1 -1
- package/dist/callbackClasses.js +14 -14
- package/dist/callbackClasses.lua +159 -300
- package/dist/callbacks.js +18 -9
- package/dist/classes/DefaultMap.d.ts +5 -1
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/classes/ModFeature.js +3 -3
- package/dist/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/classes/ModUpgraded.js +2 -4
- package/dist/classes/callbacks/InputActionFilter.d.ts +2 -2
- package/dist/classes/callbacks/InputActionFilter.d.ts.map +1 -1
- package/dist/classes/callbacks/InputActionPlayer.d.ts +2 -2
- package/dist/classes/callbacks/InputActionPlayer.d.ts.map +1 -1
- package/dist/classes/callbacks/PostCollectibleEmpty.d.ts +2 -2
- package/dist/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
- package/dist/classes/callbacks/PostCollectibleEmpty.js +1 -3
- package/dist/classes/callbacks/PostCustomRevive.d.ts +2 -4
- package/dist/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
- package/dist/classes/callbacks/PostDiceRoomActivated.d.ts +2 -3
- package/dist/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
- package/dist/classes/callbacks/PostGridEntityCollision.d.ts +2 -4
- package/dist/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -1
- package/dist/classes/callbacks/PostGridEntityCustomCollision.d.ts +2 -4
- package/dist/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -1
- package/dist/classes/callbacks/PostGridEntityCustomRemove.d.ts +2 -3
- package/dist/classes/callbacks/PostGridEntityCustomRemove.d.ts.map +1 -1
- package/dist/classes/callbacks/PostGridEntityRemove.d.ts +2 -2
- package/dist/classes/callbacks/PostGridEntityRemove.d.ts.map +1 -1
- package/dist/classes/callbacks/PostItemDischarge.d.ts +2 -2
- package/dist/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/classes/callbacks/PostItemDischarge.js +3 -6
- package/dist/classes/callbacks/PostKeyboardChanged.d.ts +2 -1
- package/dist/classes/callbacks/PostKeyboardChanged.d.ts.map +1 -1
- package/dist/classes/callbacks/PostNewRoomEarly.js +1 -1
- package/dist/classes/callbacks/PostPickupSelectionFilter.d.ts +2 -2
- package/dist/classes/callbacks/PostPickupSelectionFilter.d.ts.map +1 -1
- package/dist/classes/callbacks/PostPlayerChangeType.js +1 -1
- package/dist/classes/callbacks/PostPurchase.d.ts +2 -4
- package/dist/classes/callbacks/PostPurchase.d.ts.map +1 -1
- package/dist/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -1
- package/dist/classes/callbacks/PostTransformation.d.ts +2 -2
- package/dist/classes/callbacks/PostTransformation.d.ts.map +1 -1
- package/dist/classes/callbacks/PostTransformation.js +1 -3
- package/dist/classes/callbacks/PostTrinketBreak.d.ts.map +1 -1
- package/dist/classes/callbacks/PostTrinketBreak.js +1 -3
- package/dist/classes/callbacks/PreEntitySpawnFilter.d.ts +2 -2
- package/dist/classes/callbacks/PreEntitySpawnFilter.d.ts.map +1 -1
- package/dist/classes/callbacks/PreNewLevel.d.ts.map +1 -1
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.d.ts +2 -2
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
- package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +4 -6
- package/dist/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/ItemPickupDetection.js +6 -2
- package/dist/classes/features/callbackLogic/ItemPickupDetection.lua +6 -1
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts +0 -1
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -1
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.js +4 -4
- package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
- package/dist/classes/features/other/CustomPickups.js +1 -0
- package/dist/classes/features/other/CustomStages.js +19 -9
- package/dist/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/classes/features/other/CustomTrapdoors.js +23 -17
- package/dist/classes/features/other/CustomTrapdoors.lua +14 -7
- package/dist/classes/features/other/DebugDisplay.d.ts +0 -18
- package/dist/classes/features/other/DebugDisplay.d.ts.map +1 -1
- package/dist/classes/features/other/DeployJSONRoom.d.ts +0 -2
- package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
- package/dist/classes/features/other/DeployJSONRoom.js +2 -0
- package/dist/classes/features/other/EdenStartingStatsHealth.d.ts +1 -1
- package/dist/classes/features/other/EdenStartingStatsHealth.d.ts.map +1 -1
- package/dist/classes/features/other/ExtraConsoleCommands.d.ts +14 -10
- package/dist/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/classes/features/other/ExtraConsoleCommands.js +31 -17
- package/dist/classes/features/other/ExtraConsoleCommands.lua +2 -1
- package/dist/classes/features/other/FlyingDetection.d.ts +0 -1
- package/dist/classes/features/other/FlyingDetection.d.ts.map +1 -1
- package/dist/classes/features/other/ForgottenSwitch.d.ts +0 -1
- package/dist/classes/features/other/ForgottenSwitch.d.ts.map +1 -1
- package/dist/classes/features/other/ModdedElementDetection.js +4 -4
- package/dist/classes/features/other/ModdedElementSets.d.ts +2 -2
- package/dist/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/classes/features/other/ModdedElementSets.js +1 -1
- package/dist/classes/features/other/PickupIndexCreation.d.ts +0 -1
- package/dist/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/classes/features/other/PickupIndexCreation.js +2 -3
- package/dist/classes/features/other/PickupIndexCreation.lua +10 -10
- package/dist/classes/features/other/PonyDetection.d.ts +0 -1
- package/dist/classes/features/other/PonyDetection.d.ts.map +1 -1
- package/dist/classes/features/other/PreventChildEntities.d.ts +0 -1
- package/dist/classes/features/other/PreventChildEntities.d.ts.map +1 -1
- package/dist/classes/features/other/RoomClearFrame.d.ts +0 -1
- package/dist/classes/features/other/RoomClearFrame.d.ts.map +1 -1
- package/dist/classes/features/other/RoomHistory.d.ts +0 -1
- package/dist/classes/features/other/RoomHistory.d.ts.map +1 -1
- package/dist/classes/features/other/RunInNFrames.js +2 -2
- package/dist/classes/features/other/SaveDataManager.js +1 -1
- package/dist/classes/features/other/SpawnRockAltRewards.d.ts +0 -4
- package/dist/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
- package/dist/classes/features/other/TaintedLazarusPlayers.d.ts +0 -1
- package/dist/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
- package/dist/classes/features/other/customStages/backdrop.js +2 -3
- package/dist/classes/features/other/customStages/constants.d.ts.map +1 -1
- package/dist/classes/features/other/customStages/gridEntities.d.ts +0 -1
- package/dist/classes/features/other/customStages/gridEntities.d.ts.map +1 -1
- package/dist/classes/features/other/customStages/gridEntities.js +5 -6
- package/dist/classes/features/other/customStages/shadows.js +1 -2
- package/dist/classes/features/other/customStages/streakText.js +3 -4
- package/dist/classes/features/other/customStages/utils.d.ts +0 -2
- package/dist/classes/features/other/customStages/utils.d.ts.map +1 -1
- package/dist/classes/features/other/customStages/utils.js +2 -3
- package/dist/classes/features/other/customStages/v.d.ts.map +1 -1
- package/dist/classes/features/other/customStages/versusScreen.js +2 -3
- package/dist/classes/features/other/debugDisplay/DebugDisplayBomb.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayBomb.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayDoor.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayDoor.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayEffect.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayEffect.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayFamiliar.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayFamiliar.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayKnife.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayKnife.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayLaser.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayLaser.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayNPC.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayNPC.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPickup.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPickup.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPit.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPit.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPlayer.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPlayer.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPoop.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPoop.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPressurePlate.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayPressurePlate.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayProjectile.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayProjectile.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayRock.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayRock.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplaySlot.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplaySlot.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplaySpikes.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplaySpikes.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayTNT.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayTNT.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayTear.d.ts +0 -1
- package/dist/classes/features/other/debugDisplay/DebugDisplayTear.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/utils.d.ts +0 -2
- package/dist/classes/features/other/debugDisplay/utils.d.ts.map +1 -1
- package/dist/classes/features/other/debugDisplay/utils.js +2 -3
- package/dist/classes/features/other/extraConsoleCommands/commands.js +147 -150
- package/dist/classes/features/other/extraConsoleCommands/subroutines.js +8 -9
- package/dist/classes/features/other/saveDataManager/constants.d.ts.map +1 -1
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.d.ts +0 -1
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.d.ts.map +1 -1
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +2 -3
- package/dist/classes/features/other/saveDataManager/loadFromDisk.d.ts +0 -2
- package/dist/classes/features/other/saveDataManager/loadFromDisk.d.ts.map +1 -1
- package/dist/classes/features/other/saveDataManager/loadFromDisk.js +5 -2
- package/dist/classes/features/other/saveDataManager/loadFromDisk.lua +3 -0
- package/dist/classes/features/other/saveDataManager/restoreDefaults.d.ts +0 -1
- package/dist/classes/features/other/saveDataManager/restoreDefaults.d.ts.map +1 -1
- package/dist/classes/features/other/saveDataManager/restoreDefaults.js +3 -4
- package/dist/classes/features/other/saveDataManager/saveToDisk.d.ts +0 -2
- package/dist/classes/features/other/saveDataManager/saveToDisk.d.ts.map +1 -1
- package/dist/classes/features/other/saveDataManager/saveToDisk.js +1 -2
- package/dist/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/core/cachedClasses.d.ts +0 -5
- package/dist/core/cachedClasses.d.ts.map +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constantsVanilla.js +4 -4
- package/dist/core/upgradeMod.d.ts +0 -2
- package/dist/core/upgradeMod.d.ts.map +1 -1
- package/dist/core/upgradeMod.js +1 -2
- package/dist/decorators.js +2 -2
- package/dist/enums/ModCallbackCustom.d.ts +5 -4
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.js +5 -4
- package/dist/enums/private/GridEntityTypeCustom.d.ts.map +1 -1
- package/dist/features.js +1 -2
- package/dist/functions/ambush.js +1 -2
- package/dist/functions/array.d.ts +5 -8
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/array.js +55 -55
- package/dist/functions/array.lua +2 -2
- package/dist/functions/arrayLua.d.ts +1 -1
- package/dist/functions/arrayLua.d.ts.map +1 -1
- package/dist/functions/arrayLua.js +7 -8
- package/dist/functions/benchmark.d.ts +0 -1
- package/dist/functions/benchmark.d.ts.map +1 -1
- package/dist/functions/benchmark.js +1 -2
- package/dist/functions/bitSet128.d.ts +0 -1
- package/dist/functions/bitSet128.d.ts.map +1 -1
- package/dist/functions/bitSet128.js +5 -6
- package/dist/functions/bitwise.d.ts +0 -4
- package/dist/functions/bitwise.d.ts.map +1 -1
- package/dist/functions/bitwise.js +7 -8
- package/dist/functions/bitwise.lua +3 -3
- package/dist/functions/bombs.d.ts +0 -1
- package/dist/functions/bombs.d.ts.map +1 -1
- package/dist/functions/bombs.js +1 -2
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.js +17 -17
- package/dist/functions/cards.js +16 -17
- package/dist/functions/challenges.js +9 -10
- package/dist/functions/characters.js +17 -18
- package/dist/functions/charge.d.ts.map +1 -1
- package/dist/functions/charge.js +10 -11
- package/dist/functions/charge.lua +1 -1
- package/dist/functions/chargeBar.d.ts +0 -2
- package/dist/functions/chargeBar.d.ts.map +1 -1
- package/dist/functions/chargeBar.js +2 -3
- package/dist/functions/collectibleTag.js +2 -3
- package/dist/functions/collectibles.js +37 -38
- package/dist/functions/color.d.ts +0 -1
- package/dist/functions/color.d.ts.map +1 -1
- package/dist/functions/color.js +7 -8
- package/dist/functions/console.js +2 -3
- package/dist/functions/curses.js +2 -3
- package/dist/functions/debugFunctions.d.ts +0 -1
- package/dist/functions/debugFunctions.d.ts.map +1 -1
- package/dist/functions/debugFunctions.js +5 -6
- package/dist/functions/decorators.d.ts +4 -4
- package/dist/functions/decorators.d.ts.map +1 -1
- package/dist/functions/decorators.js +4 -5
- package/dist/functions/deepCopy.d.ts +0 -1
- package/dist/functions/deepCopy.d.ts.map +1 -1
- package/dist/functions/deepCopy.js +1 -4
- package/dist/functions/deepCopy.lua +0 -2
- package/dist/functions/deepCopyTests.js +5 -6
- package/dist/functions/dimensions.js +2 -3
- package/dist/functions/direction.js +6 -7
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.js +53 -49
- package/dist/functions/easing.js +30 -31
- package/dist/functions/effects.d.ts +0 -2
- package/dist/functions/effects.d.ts.map +1 -1
- package/dist/functions/effects.js +2 -2
- package/dist/functions/emptyRoom.js +2 -3
- package/dist/functions/entities.d.ts +3 -4
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/entities.js +32 -33
- package/dist/functions/entities.lua +4 -11
- package/dist/functions/entitiesSpecific.js +40 -41
- package/dist/functions/entityTypes.d.ts +0 -1
- package/dist/functions/entityTypes.d.ts.map +1 -1
- package/dist/functions/entityTypes.js +1 -2
- package/dist/functions/enums.d.ts +1 -6
- package/dist/functions/enums.d.ts.map +1 -1
- package/dist/functions/enums.js +12 -13
- package/dist/functions/external.js +2 -3
- package/dist/functions/familiars.js +6 -7
- package/dist/functions/flag.d.ts +1 -1
- package/dist/functions/flag.d.ts.map +1 -1
- package/dist/functions/flag.js +7 -8
- package/dist/functions/frames.d.ts +0 -1
- package/dist/functions/frames.d.ts.map +1 -1
- package/dist/functions/frames.js +18 -19
- package/dist/functions/globals.d.ts +0 -1
- package/dist/functions/globals.d.ts.map +1 -1
- package/dist/functions/globals.js +23 -15
- package/dist/functions/gridEntities.d.ts.map +1 -1
- package/dist/functions/gridEntities.js +51 -39
- package/dist/functions/gridEntities.lua +9 -5
- package/dist/functions/gridEntitiesSpecific.js +38 -39
- package/dist/functions/gridIndex.js +1 -2
- package/dist/functions/hash.js +1 -2
- package/dist/functions/hex.d.ts +0 -2
- package/dist/functions/hex.d.ts.map +1 -1
- package/dist/functions/hex.js +2 -3
- package/dist/functions/input.js +21 -21
- package/dist/functions/isaacAPIClass.d.ts +0 -20
- package/dist/functions/isaacAPIClass.d.ts.map +1 -1
- package/dist/functions/isaacAPIClass.js +23 -24
- package/dist/functions/itemPool.js +7 -8
- package/dist/functions/jsonHelpers.d.ts +4 -5
- package/dist/functions/jsonHelpers.d.ts.map +1 -1
- package/dist/functions/jsonHelpers.js +23 -14
- package/dist/functions/jsonHelpers.lua +4 -4
- package/dist/functions/jsonRoom.js +5 -6
- package/dist/functions/kColor.d.ts +0 -1
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/kColor.js +7 -8
- package/dist/functions/language.js +1 -2
- package/dist/functions/level.js +4 -5
- package/dist/functions/levelGrid.d.ts.map +1 -1
- package/dist/functions/levelGrid.js +27 -32
- package/dist/functions/log.js +4 -5
- package/dist/functions/logEntities.d.ts.map +1 -1
- package/dist/functions/logEntities.js +11 -9
- package/dist/functions/logMisc.d.ts +1 -2
- package/dist/functions/logMisc.d.ts.map +1 -1
- package/dist/functions/logMisc.js +35 -48
- package/dist/functions/logMisc.lua +3 -3
- package/dist/functions/map.d.ts +0 -2
- package/dist/functions/map.d.ts.map +1 -1
- package/dist/functions/map.js +12 -13
- package/dist/functions/math.js +13 -14
- package/dist/functions/merge.d.ts +0 -1
- package/dist/functions/merge.d.ts.map +1 -1
- package/dist/functions/merge.js +2 -3
- package/dist/functions/mergeTests.js +1 -2
- package/dist/functions/minimap.d.ts.map +1 -1
- package/dist/functions/minimap.js +12 -17
- package/dist/functions/modFeatures.js +1 -2
- package/dist/functions/newArray.d.ts +0 -1
- package/dist/functions/newArray.d.ts.map +1 -1
- package/dist/functions/newArray.js +2 -3
- package/dist/functions/nextStage.d.ts.map +1 -1
- package/dist/functions/nextStage.js +6 -3
- package/dist/functions/npcDataStructures.d.ts +0 -2
- package/dist/functions/npcDataStructures.d.ts.map +1 -1
- package/dist/functions/npcDataStructures.js +14 -15
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.js +9 -7
- package/dist/functions/pickupVariants.d.ts +0 -1
- package/dist/functions/pickupVariants.d.ts.map +1 -1
- package/dist/functions/pickupVariants.js +11 -12
- package/dist/functions/pickups.js +14 -15
- package/dist/functions/pickupsSpecific.js +40 -41
- package/dist/functions/pills.js +18 -19
- package/dist/functions/playerCenter.d.ts +0 -1
- package/dist/functions/playerCenter.d.ts.map +1 -1
- package/dist/functions/playerCenter.js +1 -2
- package/dist/functions/playerCollectibles.d.ts.map +1 -1
- package/dist/functions/playerCollectibles.js +19 -22
- package/dist/functions/playerCollectibles.lua +9 -9
- package/dist/functions/playerDataStructures.d.ts +0 -1
- package/dist/functions/playerDataStructures.d.ts.map +1 -1
- package/dist/functions/playerDataStructures.js +14 -15
- package/dist/functions/playerEffects.js +5 -6
- package/dist/functions/playerHealth.d.ts +0 -2
- package/dist/functions/playerHealth.d.ts.map +1 -1
- package/dist/functions/playerHealth.js +20 -21
- package/dist/functions/playerHealth.lua +26 -26
- package/dist/functions/playerIndex.d.ts +0 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.js +9 -10
- package/dist/functions/playerTrinkets.js +10 -11
- package/dist/functions/players.d.ts +2 -0
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.js +39 -38
- package/dist/functions/players.lua +2 -0
- package/dist/functions/pocketItems.js +8 -9
- package/dist/functions/positionVelocity.d.ts +0 -4
- package/dist/functions/positionVelocity.d.ts.map +1 -1
- package/dist/functions/positionVelocity.js +11 -20
- package/dist/functions/positionVelocity.lua +4 -4
- package/dist/functions/pressurePlate.js +1 -2
- package/dist/functions/projectiles.js +2 -3
- package/dist/functions/random.d.ts +0 -3
- package/dist/functions/random.d.ts.map +1 -1
- package/dist/functions/random.js +3 -4
- package/dist/functions/readOnly.d.ts +0 -4
- package/dist/functions/readOnly.d.ts.map +1 -1
- package/dist/functions/readOnly.js +3 -4
- package/dist/functions/render.d.ts +0 -3
- package/dist/functions/render.d.ts.map +1 -1
- package/dist/functions/render.js +3 -4
- package/dist/functions/revive.d.ts +0 -3
- package/dist/functions/revive.d.ts.map +1 -1
- package/dist/functions/revive.js +5 -6
- package/dist/functions/rng.d.ts +0 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.js +15 -15
- package/dist/functions/rockAlt.d.ts +0 -1
- package/dist/functions/rockAlt.d.ts.map +1 -1
- package/dist/functions/rockAlt.js +2 -3
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.js +15 -18
- package/dist/functions/roomGrid.js +6 -7
- package/dist/functions/roomShape.js +14 -15
- package/dist/functions/roomShapeWalls.js +2 -3
- package/dist/functions/roomTransition.js +2 -3
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.js +77 -64
- package/dist/functions/rooms.lua +2 -2
- package/dist/functions/run.js +8 -9
- package/dist/functions/seeds.d.ts +0 -1
- package/dist/functions/seeds.d.ts.map +1 -1
- package/dist/functions/seeds.js +2 -3
- package/dist/functions/serialization.js +5 -6
- package/dist/functions/set.d.ts +0 -2
- package/dist/functions/set.d.ts.map +1 -1
- package/dist/functions/set.js +22 -23
- package/dist/functions/slots.js +2 -3
- package/dist/functions/sort.d.ts.map +1 -1
- package/dist/functions/sort.js +6 -7
- package/dist/functions/sound.d.ts.map +1 -1
- package/dist/functions/sound.js +4 -9
- package/dist/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/functions/spawnCollectible.js +4 -7
- package/dist/functions/sprites.d.ts +0 -3
- package/dist/functions/sprites.d.ts.map +1 -1
- package/dist/functions/sprites.js +6 -7
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.js +44 -53
- package/dist/functions/stage.lua +5 -5
- package/dist/functions/stats.js +4 -5
- package/dist/functions/storyBosses.js +2 -3
- package/dist/functions/string.d.ts +0 -1
- package/dist/functions/string.d.ts.map +1 -1
- package/dist/functions/string.js +12 -13
- package/dist/functions/table.d.ts +0 -1
- package/dist/functions/table.d.ts.map +1 -1
- package/dist/functions/table.js +8 -9
- package/dist/functions/tears.js +6 -7
- package/dist/functions/transformations.js +5 -6
- package/dist/functions/trinketGive.js +5 -6
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.js +14 -17
- package/dist/functions/tstlClass.d.ts +2 -3
- package/dist/functions/tstlClass.d.ts.map +1 -1
- package/dist/functions/tstlClass.js +9 -10
- package/dist/functions/tstlClass.lua +2 -2
- package/dist/functions/types.d.ts +15 -17
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.js +38 -39
- package/dist/functions/types.lua +14 -14
- package/dist/functions/ui.d.ts +0 -3
- package/dist/functions/ui.d.ts.map +1 -1
- package/dist/functions/ui.js +13 -14
- package/dist/functions/utils.d.ts +0 -1
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.js +11 -12
- package/dist/functions/vector.d.ts +0 -1
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/functions/vector.js +11 -12
- package/dist/functions/versusScreen.js +4 -5
- package/dist/functions/weighted.d.ts +0 -3
- package/dist/functions/weighted.d.ts.map +1 -1
- package/dist/functions/weighted.js +2 -3
- package/dist/index.d.ts +58 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -58
- package/dist/index.lua +443 -11
- package/dist/index.rollup.d.ts +86 -69
- package/dist/indexLua.d.ts +58 -58
- package/dist/indexLua.d.ts.map +1 -1
- package/dist/indexLua.js +4 -58
- package/dist/indexLua.lua +443 -11
- package/dist/interfaces/ChargeBarSprites.d.ts +0 -2
- package/dist/interfaces/ChargeBarSprites.d.ts.map +1 -1
- package/dist/interfaces/Corner.d.ts +0 -2
- package/dist/interfaces/Corner.d.ts.map +1 -1
- package/dist/interfaces/SaveData.d.ts +0 -1
- package/dist/interfaces/SaveData.d.ts.map +1 -1
- package/dist/interfaces/TSTLClassMetatable.d.ts +0 -4
- package/dist/interfaces/TSTLClassMetatable.d.ts.map +1 -1
- package/dist/interfaces/private/AddCallbackParametersCustom.d.ts +5 -3
- package/dist/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
- package/dist/interfaces/private/ModUpgradedInterface.d.ts +0 -1
- package/dist/interfaces/private/ModUpgradedInterface.d.ts.map +1 -1
- package/dist/isaacscript-common.lua +1561 -1186
- package/dist/lib/jsonLua.js +2 -2
- package/dist/lualib_bundle.lua +107 -38
- package/dist/objects/LRoomShapeToRectangles.js +1 -1
- package/dist/objects/colors.d.ts +0 -1
- package/dist/objects/colors.d.ts.map +1 -1
- package/dist/objects/directionToVector.d.ts +0 -1
- package/dist/objects/directionToVector.d.ts.map +1 -1
- package/dist/objects/doorSlotFlagToDoorSlot.d.ts +9 -2
- package/dist/objects/doorSlotFlagToDoorSlot.d.ts.map +1 -1
- package/dist/objects/doorSlotToDoorSlotFlag.d.ts +0 -1
- package/dist/objects/doorSlotToDoorSlotFlag.d.ts.map +1 -1
- package/dist/objects/itemPoolTypeToCollectibleTypesSet.js +17 -7
- package/dist/objects/kColors.d.ts +0 -1
- package/dist/objects/kColors.d.ts.map +1 -1
- package/dist/objects/roomShapeToBottomRightPosition.d.ts +0 -1
- package/dist/objects/roomShapeToBottomRightPosition.d.ts.map +1 -1
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.js +1 -1
- package/dist/objects/roomShapeToTopLeftPosition.d.ts +0 -1
- package/dist/objects/roomShapeToTopLeftPosition.d.ts.map +1 -1
- package/dist/objects/versusScreenBackgroundColors.d.ts +0 -1
- package/dist/objects/versusScreenBackgroundColors.d.ts.map +1 -1
- package/dist/objects/versusScreenDirtSpotColors.d.ts +0 -1
- package/dist/objects/versusScreenDirtSpotColors.d.ts.map +1 -1
- package/dist/patchErrorFunctions.js +1 -2
- package/dist/serialization.js +1 -2
- package/dist/shaderCrashFix.d.ts +0 -1
- package/dist/shaderCrashFix.d.ts.map +1 -1
- package/dist/shaderCrashFix.js +1 -2
- package/dist/shouldFire.d.ts.map +1 -1
- package/dist/shouldFire.js +30 -30
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types/AddSubtract.d.ts +10 -2
- package/dist/types/AddSubtract.d.ts.map +1 -1
- package/dist/types/AnyEntity.d.ts +0 -11
- package/dist/types/AnyEntity.d.ts.map +1 -1
- package/dist/types/AnyGridEntity.d.ts +0 -8
- package/dist/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/types/PickingUpItem.js +5 -6
- package/dist/types/PickupIndex.d.ts +0 -1
- package/dist/types/PickupIndex.d.ts.map +1 -1
- package/dist/types/PlayerIndex.d.ts +0 -1
- package/dist/types/PlayerIndex.d.ts.map +1 -1
- package/dist/types/ReadonlyMap.d.ts.map +1 -1
- package/dist/types/ReadonlySet.d.ts.map +1 -1
- package/dist/types/TSTLClass.d.ts +0 -1
- package/dist/types/TSTLClass.d.ts.map +1 -1
- package/dist/types/TupleWithLengthBetween.js +2 -2
- package/dist/types/TupleWithMaxLength.js +2 -2
- package/dist/types/WeightedArray.d.ts +0 -1
- package/dist/types/WeightedArray.d.ts.map +1 -1
- package/package.json +9 -2
- package/src/callbackClasses.ts +6 -6
- package/src/classes/DefaultMap.ts +5 -2
- package/src/classes/ModFeature.ts +3 -3
- package/src/classes/ModUpgraded.ts +2 -4
- package/src/classes/callbacks/PostCollectibleEmpty.ts +1 -3
- package/src/classes/callbacks/PostItemDischarge.ts +3 -6
- package/src/classes/callbacks/PostNPCStateChanged.ts +1 -1
- package/src/classes/callbacks/PostNewRoomEarly.ts +1 -1
- package/src/classes/callbacks/PostPlayerChangeType.ts +1 -1
- package/src/classes/callbacks/PostTransformation.ts +1 -3
- package/src/classes/callbacks/PostTrinketBreak.ts +1 -3
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +1 -1
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +4 -6
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +6 -2
- package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +4 -4
- package/src/classes/features/other/CustomPickups.ts +1 -0
- package/src/classes/features/other/CustomStages.ts +2 -2
- package/src/classes/features/other/CustomTrapdoors.ts +23 -18
- package/src/classes/features/other/DeployJSONRoom.ts +2 -0
- package/src/classes/features/other/EdenStartingStatsHealth.ts +3 -1
- package/src/classes/features/other/ExtraConsoleCommands.ts +14 -10
- package/src/classes/features/other/ModdedElementDetection.ts +4 -4
- package/src/classes/features/other/ModdedElementSets.ts +3 -3
- package/src/classes/features/other/PickupIndexCreation.ts +2 -3
- package/src/classes/features/other/RunInNFrames.ts +2 -2
- package/src/classes/features/other/SaveDataManager.ts +1 -1
- package/src/classes/features/other/customStages/backdrop.ts +1 -1
- package/src/classes/features/other/extraConsoleCommands/commands.ts +7 -7
- package/src/classes/features/other/saveDataManager/loadFromDisk.ts +5 -0
- package/src/core/constants.ts +1 -1
- package/src/core/constantsVanilla.ts +4 -4
- package/src/enums/ModCallbackCustom.ts +5 -4
- package/src/functions/array.ts +33 -29
- package/src/functions/arrayLua.ts +1 -1
- package/src/functions/bosses.ts +2 -1
- package/src/functions/charge.ts +1 -2
- package/src/functions/decorators.ts +6 -9
- package/src/functions/deepCopy.ts +0 -4
- package/src/functions/deepCopyTests.ts +4 -4
- package/src/functions/doors.ts +5 -0
- package/src/functions/entities.ts +7 -14
- package/src/functions/enums.ts +4 -4
- package/src/functions/flag.ts +1 -1
- package/src/functions/globals.ts +2 -3
- package/src/functions/gridEntities.ts +19 -1
- package/src/functions/jsonHelpers.ts +7 -5
- package/src/functions/levelGrid.ts +3 -6
- package/src/functions/logEntities.ts +3 -0
- package/src/functions/logMisc.ts +9 -20
- package/src/functions/map.ts +4 -4
- package/src/functions/merge.ts +1 -1
- package/src/functions/minimap.ts +2 -6
- package/src/functions/newArray.ts +1 -1
- package/src/functions/nextStage.ts +4 -0
- package/src/functions/npcDataStructures.ts +5 -5
- package/src/functions/npcs.ts +3 -0
- package/src/functions/playerCollectibles.ts +1 -3
- package/src/functions/playerDataStructures.ts +5 -5
- package/src/functions/players.ts +2 -0
- package/src/functions/positionVelocity.ts +4 -12
- package/src/functions/rng.ts +4 -3
- package/src/functions/roomData.ts +1 -3
- package/src/functions/rooms.ts +16 -1
- package/src/functions/set.ts +8 -8
- package/src/functions/sort.ts +2 -2
- package/src/functions/sound.ts +2 -7
- package/src/functions/spawnCollectible.ts +1 -3
- package/src/functions/stage.ts +4 -14
- package/src/functions/trinkets.ts +1 -3
- package/src/functions/tstlClass.ts +2 -2
- package/src/functions/types.ts +16 -16
- package/src/index.ts +58 -58
- package/src/interfaces/SaveData.ts +2 -1
- package/src/interfaces/private/AddCallbackParametersCustom.ts +8 -3
- package/src/lib/jsonLua.js +2 -2
- package/src/objects/LRoomShapeToRectangles.ts +1 -1
- package/src/objects/roomShapeToDoorSlotsToGridIndexDelta.ts +1 -1
- package/src/shouldFire.ts +2 -1
- package/src/types/AddSubtract.ts +10 -2
- package/src/types/HasFunction.ts +1 -1
- package/src/types/Immutable.ts +1 -1
- package/src/types/TupleWithLengthBetween.ts +2 -2
- package/src/types/TupleWithMaxLength.ts +2 -2
package/dist/functions/array.js
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.arrayEquals = arrayEquals;
|
|
4
|
+
exports.arrayRemove = arrayRemove;
|
|
5
|
+
exports.arrayRemoveAll = arrayRemoveAll;
|
|
6
|
+
exports.arrayRemoveAllInPlace = arrayRemoveAllInPlace;
|
|
7
|
+
exports.arrayRemoveInPlace = arrayRemoveInPlace;
|
|
8
|
+
exports.arrayRemoveIndex = arrayRemoveIndex;
|
|
9
|
+
exports.arrayRemoveIndexInPlace = arrayRemoveIndexInPlace;
|
|
10
|
+
exports.arrayToString = arrayToString;
|
|
11
|
+
exports.combineArrays = combineArrays;
|
|
12
|
+
exports.copyArray = copyArray;
|
|
13
|
+
exports.emptyArray = emptyArray;
|
|
14
|
+
exports.filterMap = filterMap;
|
|
15
|
+
exports.getArrayCombinations = getArrayCombinations;
|
|
16
|
+
exports.getArrayDuplicateElements = getArrayDuplicateElements;
|
|
17
|
+
exports.getArrayIndexes = getArrayIndexes;
|
|
18
|
+
exports.getHighestArrayElement = getHighestArrayElement;
|
|
19
|
+
exports.getLowestArrayElement = getLowestArrayElement;
|
|
20
|
+
exports.getRandomArrayElement = getRandomArrayElement;
|
|
21
|
+
exports.getRandomArrayElementAndRemove = getRandomArrayElementAndRemove;
|
|
22
|
+
exports.getRandomArrayIndex = getRandomArrayIndex;
|
|
23
|
+
exports.includes = includes;
|
|
24
|
+
exports.isArray = isArray;
|
|
25
|
+
exports.isArrayContiguous = isArrayContiguous;
|
|
26
|
+
exports.isArrayElementsUnique = isArrayElementsUnique;
|
|
27
|
+
exports.isArrayInArray = isArrayInArray;
|
|
28
|
+
exports.setAllArrayElements = setAllArrayElements;
|
|
29
|
+
exports.shuffleArray = shuffleArray;
|
|
30
|
+
exports.shuffleArrayInPlace = shuffleArrayInPlace;
|
|
31
|
+
exports.sumArray = sumArray;
|
|
32
|
+
exports.swapArrayElements = swapArrayElements;
|
|
4
33
|
const ReadonlySet_1 = require("../types/ReadonlySet");
|
|
5
34
|
const random_1 = require("./random");
|
|
6
35
|
const rng_1 = require("./rng");
|
|
@@ -20,7 +49,6 @@ function arrayEquals(array1, array2) {
|
|
|
20
49
|
return array1Element === array2Element;
|
|
21
50
|
});
|
|
22
51
|
}
|
|
23
|
-
exports.arrayEquals = arrayEquals;
|
|
24
52
|
/**
|
|
25
53
|
* Builds a new array based on the original array without the specified element(s). Returns the new
|
|
26
54
|
* array. If the specified element(s) are not found in the array, it will simply return a shallow
|
|
@@ -32,7 +60,7 @@ exports.arrayEquals = arrayEquals;
|
|
|
32
60
|
* matching element. If you want to remove all of the elements, use the `arrayRemoveAll` function
|
|
33
61
|
* instead.
|
|
34
62
|
*/
|
|
35
|
-
// eslint-disable-next-line
|
|
63
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
36
64
|
function arrayRemove(originalArray, ...elementsToRemove) {
|
|
37
65
|
const elementsToRemoveSet = new ReadonlySet_1.ReadonlySet(elementsToRemove);
|
|
38
66
|
const array = [];
|
|
@@ -43,7 +71,6 @@ function arrayRemove(originalArray, ...elementsToRemove) {
|
|
|
43
71
|
}
|
|
44
72
|
return array;
|
|
45
73
|
}
|
|
46
|
-
exports.arrayRemove = arrayRemove;
|
|
47
74
|
/**
|
|
48
75
|
* Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
|
|
49
76
|
* the specified element(s) are not found in the array, it will simply return a shallow copy of the
|
|
@@ -55,13 +82,12 @@ exports.arrayRemove = arrayRemove;
|
|
|
55
82
|
* element. If you want to only remove the first matching element, use the `arrayRemove` function
|
|
56
83
|
* instead.
|
|
57
84
|
*/
|
|
58
|
-
// eslint-disable-next-line
|
|
85
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
59
86
|
function arrayRemoveAll(originalArray, ...elementsToRemove) {
|
|
60
87
|
const array = copyArray(originalArray);
|
|
61
88
|
arrayRemoveAllInPlace(array, ...elementsToRemove);
|
|
62
89
|
return array;
|
|
63
90
|
}
|
|
64
|
-
exports.arrayRemoveAll = arrayRemoveAll;
|
|
65
91
|
/**
|
|
66
92
|
* Removes all of the specified element(s) from the array. If the specified element(s) are not found
|
|
67
93
|
* in the array, this function will do nothing.
|
|
@@ -75,7 +101,7 @@ exports.arrayRemoveAll = arrayRemoveAll;
|
|
|
75
101
|
* @returns True if one or more elements were removed, false otherwise.
|
|
76
102
|
*/
|
|
77
103
|
function arrayRemoveAllInPlace(
|
|
78
|
-
// eslint-disable-next-line
|
|
104
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
79
105
|
array, ...elementsToRemove) {
|
|
80
106
|
let removedOneOrMoreElements = false;
|
|
81
107
|
for (const element of elementsToRemove) {
|
|
@@ -90,7 +116,6 @@ array, ...elementsToRemove) {
|
|
|
90
116
|
}
|
|
91
117
|
return removedOneOrMoreElements;
|
|
92
118
|
}
|
|
93
|
-
exports.arrayRemoveAllInPlace = arrayRemoveAllInPlace;
|
|
94
119
|
/**
|
|
95
120
|
* Removes the specified element(s) from the array. If the specified element(s) are not found in the
|
|
96
121
|
* array, this function will do nothing.
|
|
@@ -103,21 +128,20 @@ exports.arrayRemoveAllInPlace = arrayRemoveAllInPlace;
|
|
|
103
128
|
*
|
|
104
129
|
* @returns The removed elements. This will be an empty array if no elements were removed.
|
|
105
130
|
*/
|
|
106
|
-
// eslint-disable-next-line
|
|
131
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
107
132
|
function arrayRemoveInPlace(
|
|
108
|
-
// eslint-disable-next-line
|
|
133
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
109
134
|
array, ...elementsToRemove) {
|
|
110
135
|
const removedElements = [];
|
|
111
136
|
for (const element of elementsToRemove) {
|
|
112
137
|
const index = array.indexOf(element);
|
|
113
|
-
if (index
|
|
138
|
+
if (index !== -1) {
|
|
114
139
|
const removedElement = array.splice(index, 1);
|
|
115
140
|
removedElements.push(...removedElement);
|
|
116
141
|
}
|
|
117
142
|
}
|
|
118
143
|
return removedElements;
|
|
119
144
|
}
|
|
120
|
-
exports.arrayRemoveInPlace = arrayRemoveInPlace;
|
|
121
145
|
/**
|
|
122
146
|
* Shallow copies and removes the elements at the specified indexes from the array. Returns the
|
|
123
147
|
* copied array. If the specified indexes are not found in the array, it will simply return a
|
|
@@ -125,7 +149,7 @@ exports.arrayRemoveInPlace = arrayRemoveInPlace;
|
|
|
125
149
|
*
|
|
126
150
|
* This function is variadic, meaning that you can specify N arguments to remove N elements.
|
|
127
151
|
*/
|
|
128
|
-
// eslint-disable-next-line
|
|
152
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
129
153
|
function arrayRemoveIndex(originalArray, ...indexesToRemove) {
|
|
130
154
|
const indexesToRemoveSet = new ReadonlySet_1.ReadonlySet(indexesToRemove);
|
|
131
155
|
const array = [];
|
|
@@ -136,7 +160,6 @@ function arrayRemoveIndex(originalArray, ...indexesToRemove) {
|
|
|
136
160
|
}
|
|
137
161
|
return array;
|
|
138
162
|
}
|
|
139
|
-
exports.arrayRemoveIndex = arrayRemoveIndex;
|
|
140
163
|
/**
|
|
141
164
|
* Removes the elements at the specified indexes from the array. If the specified indexes are not
|
|
142
165
|
* found in the array, this function will do nothing.
|
|
@@ -145,9 +168,9 @@ exports.arrayRemoveIndex = arrayRemoveIndex;
|
|
|
145
168
|
*
|
|
146
169
|
* @returns The removed elements. This will be an empty array if no elements were removed.
|
|
147
170
|
*/
|
|
148
|
-
// eslint-disable-next-line
|
|
171
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
149
172
|
function arrayRemoveIndexInPlace(
|
|
150
|
-
// eslint-disable-next-line
|
|
173
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
151
174
|
array, ...indexesToRemove) {
|
|
152
175
|
const legalIndexes = indexesToRemove.filter((i) => i >= 0 && i < array.length);
|
|
153
176
|
if (legalIndexes.length === 0) {
|
|
@@ -163,7 +186,6 @@ array, ...indexesToRemove) {
|
|
|
163
186
|
}
|
|
164
187
|
return removedElements;
|
|
165
188
|
}
|
|
166
|
-
exports.arrayRemoveIndexInPlace = arrayRemoveIndexInPlace;
|
|
167
189
|
function arrayToString(array) {
|
|
168
190
|
if (array.length === 0) {
|
|
169
191
|
return "[]";
|
|
@@ -172,7 +194,6 @@ function arrayToString(array) {
|
|
|
172
194
|
const commaSeparatedStrings = strings.join(", ");
|
|
173
195
|
return `[${commaSeparatedStrings}]`;
|
|
174
196
|
}
|
|
175
|
-
exports.arrayToString = arrayToString;
|
|
176
197
|
/**
|
|
177
198
|
* Helper function to combine two or more arrays. Returns a new array that is the composition of all
|
|
178
199
|
* of the specified arrays.
|
|
@@ -180,7 +201,7 @@ exports.arrayToString = arrayToString;
|
|
|
180
201
|
* This function is variadic, meaning that you can specify N arguments to combine N arrays. Note
|
|
181
202
|
* that this will only perform a shallow copy of the array elements.
|
|
182
203
|
*/
|
|
183
|
-
// eslint-disable-next-line
|
|
204
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
184
205
|
function combineArrays(...arrays) {
|
|
185
206
|
const elements = [];
|
|
186
207
|
for (const array of arrays) {
|
|
@@ -190,7 +211,6 @@ function combineArrays(...arrays) {
|
|
|
190
211
|
}
|
|
191
212
|
return elements;
|
|
192
213
|
}
|
|
193
|
-
exports.combineArrays = combineArrays;
|
|
194
214
|
/**
|
|
195
215
|
* Helper function to perform a shallow copy.
|
|
196
216
|
*
|
|
@@ -198,7 +218,7 @@ exports.combineArrays = combineArrays;
|
|
|
198
218
|
* @param numElements Optional. If specified, will only copy the first N elements. By default, the
|
|
199
219
|
* entire array will be copied.
|
|
200
220
|
*/
|
|
201
|
-
// eslint-disable-next-line
|
|
221
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
202
222
|
function copyArray(oldArray, numElements) {
|
|
203
223
|
// Using the spread operator was benchmarked to be faster than manually creating an array using
|
|
204
224
|
// the below algorithm.
|
|
@@ -212,13 +232,11 @@ function copyArray(oldArray, numElements) {
|
|
|
212
232
|
}
|
|
213
233
|
return newArrayWithFirstNElements;
|
|
214
234
|
}
|
|
215
|
-
exports.copyArray = copyArray;
|
|
216
235
|
/** Helper function to remove all of the elements in an array in-place. */
|
|
217
|
-
// eslint-disable-next-line
|
|
236
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
218
237
|
function emptyArray(array) {
|
|
219
|
-
array.splice(0
|
|
238
|
+
array.splice(0);
|
|
220
239
|
}
|
|
221
|
-
exports.emptyArray = emptyArray;
|
|
222
240
|
/**
|
|
223
241
|
* Helper function to perform a filter and a map at the same time. Similar to `Array.map`, provide a
|
|
224
242
|
* function that transforms a value, but return `undefined` if the value should be skipped. (Thus,
|
|
@@ -230,7 +248,7 @@ exports.emptyArray = emptyArray;
|
|
|
230
248
|
* This is named `filterMap` after the Rust function:
|
|
231
249
|
* https://doc.rust-lang.org/std/iter/struct.FilterMap.html
|
|
232
250
|
*/
|
|
233
|
-
// eslint-disable-next-line
|
|
251
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
234
252
|
function filterMap(array, func) {
|
|
235
253
|
const filteredArray = [];
|
|
236
254
|
for (const element of array) {
|
|
@@ -241,7 +259,6 @@ function filterMap(array, func) {
|
|
|
241
259
|
}
|
|
242
260
|
return filteredArray;
|
|
243
261
|
}
|
|
244
|
-
exports.filterMap = filterMap;
|
|
245
262
|
/**
|
|
246
263
|
* Helper function to get all possible combinations of the given array. This includes the
|
|
247
264
|
* combination of an empty array.
|
|
@@ -286,9 +303,10 @@ function getArrayCombinations(array, includeEmptyArray, min, max) {
|
|
|
286
303
|
}
|
|
287
304
|
return all;
|
|
288
305
|
}
|
|
289
|
-
exports.getArrayCombinations = getArrayCombinations;
|
|
290
306
|
/** Mutates the `all` array in-place. */
|
|
291
|
-
function addCombinations(n, src, got,
|
|
307
|
+
function addCombinations(n, src, got,
|
|
308
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
309
|
+
all) {
|
|
292
310
|
if (n === 0) {
|
|
293
311
|
if (got.length > 0) {
|
|
294
312
|
all[all.length] = got;
|
|
@@ -315,7 +333,6 @@ function getArrayDuplicateElements(array) {
|
|
|
315
333
|
const values = [...duplicateElements];
|
|
316
334
|
return values.sort(sort_1.sortNormal);
|
|
317
335
|
}
|
|
318
|
-
exports.getArrayDuplicateElements = getArrayDuplicateElements;
|
|
319
336
|
/**
|
|
320
337
|
* Helper function to get an array containing the indexes of an array.
|
|
321
338
|
*
|
|
@@ -328,7 +345,6 @@ exports.getArrayDuplicateElements = getArrayDuplicateElements;
|
|
|
328
345
|
function getArrayIndexes(array) {
|
|
329
346
|
return (0, utils_1.eRange)(array.length);
|
|
330
347
|
}
|
|
331
|
-
exports.getArrayIndexes = getArrayIndexes;
|
|
332
348
|
/**
|
|
333
349
|
* Helper function to get the highest value in an array. Returns undefined if there were no elements
|
|
334
350
|
* in the array.
|
|
@@ -345,7 +361,6 @@ function getHighestArrayElement(array) {
|
|
|
345
361
|
}
|
|
346
362
|
return highestValue;
|
|
347
363
|
}
|
|
348
|
-
exports.getHighestArrayElement = getHighestArrayElement;
|
|
349
364
|
/**
|
|
350
365
|
* Helper function to get the lowest value in an array. Returns undefined if there were no elements
|
|
351
366
|
* in the array.
|
|
@@ -362,7 +377,6 @@ function getLowestArrayElement(array) {
|
|
|
362
377
|
}
|
|
363
378
|
return lowestValue;
|
|
364
379
|
}
|
|
365
|
-
exports.getLowestArrayElement = getLowestArrayElement;
|
|
366
380
|
/**
|
|
367
381
|
* Helper function to get a random element from the provided array.
|
|
368
382
|
*
|
|
@@ -385,7 +399,6 @@ function getRandomArrayElement(array, seedOrRNG, exceptions = []) {
|
|
|
385
399
|
(0, utils_1.assertDefined)(randomElement, `Failed to get a random array element since the random index of ${randomIndex} was not valid.`);
|
|
386
400
|
return randomElement;
|
|
387
401
|
}
|
|
388
|
-
exports.getRandomArrayElement = getRandomArrayElement;
|
|
389
402
|
/**
|
|
390
403
|
* Helper function to get a random element from the provided array. Once the random element is
|
|
391
404
|
* decided, it is then removed from the array (in-place).
|
|
@@ -400,13 +413,12 @@ exports.getRandomArrayElement = getRandomArrayElement;
|
|
|
400
413
|
* @param exceptions Optional. An array of elements to skip over if selected.
|
|
401
414
|
*/
|
|
402
415
|
function getRandomArrayElementAndRemove(
|
|
403
|
-
// eslint-disable-next-line
|
|
416
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
404
417
|
array, seedOrRNG, exceptions = []) {
|
|
405
418
|
const randomArrayElement = getRandomArrayElement(array, seedOrRNG, exceptions);
|
|
406
419
|
arrayRemoveInPlace(array, randomArrayElement);
|
|
407
420
|
return randomArrayElement;
|
|
408
421
|
}
|
|
409
|
-
exports.getRandomArrayElementAndRemove = getRandomArrayElementAndRemove;
|
|
410
422
|
/**
|
|
411
423
|
* Helper function to get a random index from the provided array.
|
|
412
424
|
*
|
|
@@ -426,7 +438,6 @@ function getRandomArrayIndex(array, seedOrRNG, exceptions = []) {
|
|
|
426
438
|
}
|
|
427
439
|
return (0, random_1.getRandomInt)(0, array.length - 1, seedOrRNG, exceptions);
|
|
428
440
|
}
|
|
429
|
-
exports.getRandomArrayIndex = getRandomArrayIndex;
|
|
430
441
|
/**
|
|
431
442
|
* Similar to the `Array.includes` method, but works on a widened version of the array.
|
|
432
443
|
*
|
|
@@ -437,7 +448,6 @@ function includes(array, searchElement) {
|
|
|
437
448
|
const widenedArray = array;
|
|
438
449
|
return widenedArray.includes(searchElement);
|
|
439
450
|
}
|
|
440
|
-
exports.includes = includes;
|
|
441
451
|
/**
|
|
442
452
|
* Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a
|
|
443
453
|
* particular table is being used as an array. `isArray` returns true if:
|
|
@@ -480,7 +490,6 @@ function isArray(object, ensureContiguousValues = true) {
|
|
|
480
490
|
}
|
|
481
491
|
return true;
|
|
482
492
|
}
|
|
483
|
-
exports.isArray = isArray;
|
|
484
493
|
/**
|
|
485
494
|
* Helper function to see if every element in the array is N + 1.
|
|
486
495
|
*
|
|
@@ -489,16 +498,13 @@ exports.isArray = isArray;
|
|
|
489
498
|
function isArrayContiguous(array) {
|
|
490
499
|
let lastValue;
|
|
491
500
|
for (const element of array) {
|
|
492
|
-
|
|
493
|
-
lastValue = element - 1;
|
|
494
|
-
}
|
|
501
|
+
lastValue ??= element - 1;
|
|
495
502
|
if (element !== lastValue - 1) {
|
|
496
503
|
return false;
|
|
497
504
|
}
|
|
498
505
|
}
|
|
499
506
|
return true;
|
|
500
507
|
}
|
|
501
|
-
exports.isArrayContiguous = isArrayContiguous;
|
|
502
508
|
/**
|
|
503
509
|
* Helper function to check if all the elements of an array are unique within that array.
|
|
504
510
|
*
|
|
@@ -508,20 +514,17 @@ function isArrayElementsUnique(array) {
|
|
|
508
514
|
const set = new Set(array);
|
|
509
515
|
return set.size === array.length;
|
|
510
516
|
}
|
|
511
|
-
exports.isArrayElementsUnique = isArrayElementsUnique;
|
|
512
517
|
/** Checks if an array is in the provided 2-dimensional array. */
|
|
513
518
|
function isArrayInArray(arrayToMatch, parentArray) {
|
|
514
519
|
return parentArray.some((element) => arrayEquals(element, arrayToMatch));
|
|
515
520
|
}
|
|
516
|
-
exports.isArrayInArray = isArrayInArray;
|
|
517
521
|
/** Helper function to set every element in an array to a specific value. */
|
|
518
|
-
// eslint-disable-next-line
|
|
522
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
519
523
|
function setAllArrayElements(array, value) {
|
|
520
524
|
for (let i = 0; i < array.length; i++) {
|
|
521
525
|
array[i] = value;
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
|
-
exports.setAllArrayElements = setAllArrayElements;
|
|
525
528
|
/**
|
|
526
529
|
* Shallow copies and shuffles the array using the Fisher-Yates algorithm. Returns the copied array.
|
|
527
530
|
*
|
|
@@ -535,13 +538,12 @@ exports.setAllArrayElements = setAllArrayElements;
|
|
|
535
538
|
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
|
|
536
539
|
* a random seed.
|
|
537
540
|
*/
|
|
538
|
-
// eslint-disable-next-line
|
|
541
|
+
// eslint-disable-next-line complete/no-mutable-return
|
|
539
542
|
function shuffleArray(originalArray, seedOrRNG) {
|
|
540
543
|
const array = copyArray(originalArray);
|
|
541
544
|
shuffleArrayInPlace(array, seedOrRNG);
|
|
542
545
|
return array;
|
|
543
546
|
}
|
|
544
|
-
exports.shuffleArray = shuffleArray;
|
|
545
547
|
/**
|
|
546
548
|
* Shuffles the provided array in-place using the Fisher-Yates algorithm.
|
|
547
549
|
*
|
|
@@ -556,7 +558,7 @@ exports.shuffleArray = shuffleArray;
|
|
|
556
558
|
* a random seed.
|
|
557
559
|
*/
|
|
558
560
|
function shuffleArrayInPlace(
|
|
559
|
-
// eslint-disable-next-line
|
|
561
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
560
562
|
array, seedOrRNG) {
|
|
561
563
|
let currentIndex = array.length;
|
|
562
564
|
const rng = (0, rng_1.isRNG)(seedOrRNG) ? seedOrRNG : (0, rng_1.newRNG)(seedOrRNG);
|
|
@@ -566,20 +568,18 @@ array, seedOrRNG) {
|
|
|
566
568
|
swapArrayElements(array, currentIndex, randomIndex);
|
|
567
569
|
}
|
|
568
570
|
}
|
|
569
|
-
exports.shuffleArrayInPlace = shuffleArrayInPlace;
|
|
570
571
|
/** Helper function to sum every value in an array together. */
|
|
571
572
|
function sumArray(array) {
|
|
572
573
|
return array.reduce((accumulator, element) => accumulator + element, 0);
|
|
573
574
|
}
|
|
574
|
-
exports.sumArray = sumArray;
|
|
575
575
|
/**
|
|
576
576
|
* Helper function to swap two different array elements. (The elements will be swapped in-place.)
|
|
577
577
|
*/
|
|
578
|
-
|
|
579
|
-
|
|
578
|
+
function swapArrayElements(
|
|
579
|
+
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
580
|
+
array, i, j) {
|
|
580
581
|
const value1 = array[i]; // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
581
582
|
const value2 = array[j]; // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
582
583
|
array[i] = value2;
|
|
583
584
|
array[j] = value1;
|
|
584
585
|
}
|
|
585
|
-
exports.swapArrayElements = swapArrayElements;
|
package/dist/functions/array.lua
CHANGED
|
@@ -223,7 +223,7 @@ function ____exports.arrayRemoveInPlace(self, array, ...)
|
|
|
223
223
|
local removedElements = {}
|
|
224
224
|
for ____, element in ipairs(elementsToRemove) do
|
|
225
225
|
local index = __TS__ArrayIndexOf(array, element)
|
|
226
|
-
if index
|
|
226
|
+
if index ~= -1 then
|
|
227
227
|
local removedElement = __TS__ArraySplice(array, index, 1)
|
|
228
228
|
__TS__ArrayPushArray(removedElements, removedElement)
|
|
229
229
|
end
|
|
@@ -305,7 +305,7 @@ function ____exports.combineArrays(self, ...)
|
|
|
305
305
|
end
|
|
306
306
|
--- Helper function to remove all of the elements in an array in-place.
|
|
307
307
|
function ____exports.emptyArray(self, array)
|
|
308
|
-
__TS__ArraySplice(array, 0
|
|
308
|
+
__TS__ArraySplice(array, 0)
|
|
309
309
|
end
|
|
310
310
|
--- Helper function to perform a filter and a map at the same time. Similar to `Array.map`, provide a
|
|
311
311
|
-- function that transforms a value, but return `undefined` if the value should be skipped. (Thus,
|
|
@@ -39,7 +39,7 @@ export declare function forEach<T>(array: readonly T[], func: (value: T, index:
|
|
|
39
39
|
*
|
|
40
40
|
* Internally, this just calls `Array.join`.
|
|
41
41
|
*/
|
|
42
|
-
export declare function join
|
|
42
|
+
export declare function join(array: readonly unknown[], separator: string): string;
|
|
43
43
|
/**
|
|
44
44
|
* Helper function for non-TypeScript users to convert all of the elements in an array to something
|
|
45
45
|
* else.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayLua.d.ts","sourceRoot":"","sources":["../../src/functions/arrayLua.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EACrB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,SAAS,CAAC,EAAE,CAEd;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,CAAC,GAAG,SAAS,CAEf;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,IAAI,GAC3D,IAAI,CAEN;AAID;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"arrayLua.d.ts","sourceRoot":"","sources":["../../src/functions/arrayLua.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EACrB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,SAAS,CAAC,EAAE,CAEd;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,CAAC,GAAG,SAAS,CAEf;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,IAAI,GAC3D,IAAI,CAEN;AAID;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EACtB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,GACxD,SAAS,CAAC,EAAE,CAEd;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,GAC9D,OAAO,CAET"}
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.every = every;
|
|
13
|
+
exports.filter = filter;
|
|
14
|
+
exports.find = find;
|
|
15
|
+
exports.forEach = forEach;
|
|
16
|
+
exports.join = join;
|
|
17
|
+
exports.map = map;
|
|
18
|
+
exports.some = some;
|
|
13
19
|
/**
|
|
14
20
|
* Helper function for non-TypeScript users to check if every element in the array is equal to a
|
|
15
21
|
* condition.
|
|
@@ -19,7 +25,6 @@ exports.some = exports.map = exports.join = exports.forEach = exports.find = exp
|
|
|
19
25
|
function every(array, func) {
|
|
20
26
|
return array.every(func);
|
|
21
27
|
}
|
|
22
|
-
exports.every = every;
|
|
23
28
|
/**
|
|
24
29
|
* Helper function for non-TypeScript users to filter the elements in an array. Returns the filtered
|
|
25
30
|
* array.
|
|
@@ -29,7 +34,6 @@ exports.every = every;
|
|
|
29
34
|
function filter(array, func) {
|
|
30
35
|
return array.filter(func);
|
|
31
36
|
}
|
|
32
|
-
exports.filter = filter;
|
|
33
37
|
/**
|
|
34
38
|
* Helper function for non-TypeScript users to find an element in an array.
|
|
35
39
|
*
|
|
@@ -38,7 +42,6 @@ exports.filter = filter;
|
|
|
38
42
|
function find(array, func) {
|
|
39
43
|
return array.find(func);
|
|
40
44
|
}
|
|
41
|
-
exports.find = find;
|
|
42
45
|
/**
|
|
43
46
|
* Helper function for non-TypeScript users to iterate over an array.
|
|
44
47
|
*
|
|
@@ -47,7 +50,6 @@ exports.find = find;
|
|
|
47
50
|
function forEach(array, func) {
|
|
48
51
|
array.forEach(func); // eslint-disable-line unicorn/no-array-for-each
|
|
49
52
|
}
|
|
50
|
-
exports.forEach = forEach;
|
|
51
53
|
// `includes` is not included since there is a normal array helper function of that name.
|
|
52
54
|
/**
|
|
53
55
|
* Helper function for non-TypeScript users to convert an array to a string with the specified
|
|
@@ -58,7 +60,6 @@ exports.forEach = forEach;
|
|
|
58
60
|
function join(array, separator) {
|
|
59
61
|
return array.join(separator);
|
|
60
62
|
}
|
|
61
|
-
exports.join = join;
|
|
62
63
|
/**
|
|
63
64
|
* Helper function for non-TypeScript users to convert all of the elements in an array to something
|
|
64
65
|
* else.
|
|
@@ -68,7 +69,6 @@ exports.join = join;
|
|
|
68
69
|
function map(array, func) {
|
|
69
70
|
return array.map(func);
|
|
70
71
|
}
|
|
71
|
-
exports.map = map;
|
|
72
72
|
/**
|
|
73
73
|
* Helper function for non-TypeScript users to check if one or more elements in the array is equal
|
|
74
74
|
* to a condition.
|
|
@@ -78,4 +78,3 @@ exports.map = map;
|
|
|
78
78
|
function some(array, func) {
|
|
79
79
|
return array.some(func);
|
|
80
80
|
}
|
|
81
|
-
exports.some = some;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/functions/benchmark.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/functions/benchmark.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,GAAG,EACd,GAAG,SAAS,EAAE,aAAa,CAAC,MAAM,IAAI,CAAC,GACtC,SAAS,GAAG,EAAE,CAsBhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.benchmark =
|
|
3
|
+
exports.benchmark = benchmark;
|
|
4
4
|
const log_1 = require("./log");
|
|
5
5
|
/**
|
|
6
6
|
* Helper function to benchmark the performance of a function.
|
|
@@ -33,4 +33,3 @@ function benchmark(numTrials, ...functions) {
|
|
|
33
33
|
}
|
|
34
34
|
return averages;
|
|
35
35
|
}
|
|
36
|
-
exports.benchmark = benchmark;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitSet128.d.ts","sourceRoot":"","sources":["../../src/functions/bitSet128.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitSet128.d.ts","sourceRoot":"","sources":["../../src/functions/bitSet128.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAW9E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1D,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC,WAAW,CAAC;CACxD,CAAC;AAKF,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,mBAAmB,GAC7B,SAAS,CAmBX;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CAEhE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,mBAAmB,CAQ/B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAW5E"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.copyBitSet128 = copyBitSet128;
|
|
4
|
+
exports.deserializeBitSet128 = deserializeBitSet128;
|
|
5
|
+
exports.isBitSet128 = isBitSet128;
|
|
6
|
+
exports.isSerializedBitSet128 = isSerializedBitSet128;
|
|
7
|
+
exports.serializeBitSet128 = serializeBitSet128;
|
|
4
8
|
const SerializationBrand_1 = require("../enums/private/SerializationBrand");
|
|
5
9
|
const isaacAPIClass_1 = require("./isaacAPIClass");
|
|
6
10
|
const table_1 = require("./table");
|
|
@@ -17,7 +21,6 @@ function copyBitSet128(bitSet128) {
|
|
|
17
21
|
const highBits = bitSet128.h;
|
|
18
22
|
return BitSet128(lowBits, highBits);
|
|
19
23
|
}
|
|
20
|
-
exports.copyBitSet128 = copyBitSet128;
|
|
21
24
|
/**
|
|
22
25
|
* Helper function to convert a `SerializedBitSet128` object to a normal `BitSet128` object. (This
|
|
23
26
|
* is used by the save data manager when reading data from the "save#.dat" file.)
|
|
@@ -31,12 +34,10 @@ function deserializeBitSet128(bitSet128) {
|
|
|
31
34
|
(0, utils_1.assertDefined)(h, `Failed to deserialize a ${OBJECT_NAME} object since the provided object did not have a value for: h`);
|
|
32
35
|
return BitSet128(l, h);
|
|
33
36
|
}
|
|
34
|
-
exports.deserializeBitSet128 = deserializeBitSet128;
|
|
35
37
|
/** Helper function to check if something is an instantiated `BitSet128` object. */
|
|
36
38
|
function isBitSet128(object) {
|
|
37
39
|
return (0, isaacAPIClass_1.isIsaacAPIClassOfType)(object, OBJECT_NAME);
|
|
38
40
|
}
|
|
39
|
-
exports.isBitSet128 = isBitSet128;
|
|
40
41
|
/**
|
|
41
42
|
* Used to determine is the given table is a serialized `BitSet128` object created by the `deepCopy`
|
|
42
43
|
* function.
|
|
@@ -47,7 +48,6 @@ function isSerializedBitSet128(object) {
|
|
|
47
48
|
}
|
|
48
49
|
return ((0, table_1.tableHasKeys)(object, ...KEYS) && object.has(SerializationBrand_1.SerializationBrand.BIT_SET_128));
|
|
49
50
|
}
|
|
50
|
-
exports.isSerializedBitSet128 = isSerializedBitSet128;
|
|
51
51
|
/**
|
|
52
52
|
* Helper function to convert a `BitSet128` object to a `SerializedBitSet128` object. (This is used
|
|
53
53
|
* by the save data manager when writing data from the "save#.dat" file.)
|
|
@@ -61,4 +61,3 @@ function serializeBitSet128(bitSet128) {
|
|
|
61
61
|
bitSet128Table.set(SerializationBrand_1.SerializationBrand.BIT_SET_128, "");
|
|
62
62
|
return bitSet128Table;
|
|
63
63
|
}
|
|
64
|
-
exports.serializeBitSet128 = serializeBitSet128;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
4
|
-
/// <reference types="isaac-typescript-definitions" />
|
|
5
1
|
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
6
2
|
export declare function arrayToBitFlags<T extends BitFlag | BitFlag128>(array: readonly T[]): BitFlags<T>;
|
|
7
3
|
/** Helper function to convert an array of bits to the resulting decimal number. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitwise.d.ts","sourceRoot":"","sources":["../../src/functions/bitwise.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitwise.d.ts","sourceRoot":"","sources":["../../src/functions/bitwise.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,UAAU,EAC5D,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB,QAAQ,CAAC,CAAC,CAAC,CAOb;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,MAAM,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,GAAG,GACd,SAAS,GAAG,EAAE,CAqBhB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAS1C;AAED,iGAAiG;AACjG,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,CAE9C;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAQzC;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,UAAU,EAC1D,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAClB,QAAQ,CAAC,CAAC,CAAC,CAOb"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.arrayToBitFlags = arrayToBitFlags;
|
|
4
|
+
exports.convertBinaryToDecimal = convertBinaryToDecimal;
|
|
5
|
+
exports.convertDecimalToBinary = convertDecimalToBinary;
|
|
6
|
+
exports.countSetBits = countSetBits;
|
|
7
|
+
exports.getKBitOfN = getKBitOfN;
|
|
8
|
+
exports.getNumBitsOfN = getNumBitsOfN;
|
|
9
|
+
exports.setToBitFlags = setToBitFlags;
|
|
4
10
|
const flag_1 = require("./flag");
|
|
5
11
|
const types_1 = require("./types");
|
|
6
12
|
const utils_1 = require("./utils");
|
|
@@ -12,13 +18,11 @@ function arrayToBitFlags(array) {
|
|
|
12
18
|
}
|
|
13
19
|
return flags;
|
|
14
20
|
}
|
|
15
|
-
exports.arrayToBitFlags = arrayToBitFlags;
|
|
16
21
|
/** Helper function to convert an array of bits to the resulting decimal number. */
|
|
17
22
|
function convertBinaryToDecimal(bits) {
|
|
18
23
|
const bitsString = bits.join("");
|
|
19
24
|
return Number.parseInt(bitsString, 2);
|
|
20
25
|
}
|
|
21
|
-
exports.convertBinaryToDecimal = convertBinaryToDecimal;
|
|
22
26
|
/**
|
|
23
27
|
* Helper function to convert a number to an array of bits.
|
|
24
28
|
*
|
|
@@ -43,7 +47,6 @@ function convertDecimalToBinary(num, minLength) {
|
|
|
43
47
|
}
|
|
44
48
|
return bits;
|
|
45
49
|
}
|
|
46
|
-
exports.convertDecimalToBinary = convertDecimalToBinary;
|
|
47
50
|
/**
|
|
48
51
|
* Helper function to count the number of bits that are set to 1 in a binary representation of a
|
|
49
52
|
* number.
|
|
@@ -56,12 +59,10 @@ function countSetBits(num) {
|
|
|
56
59
|
}
|
|
57
60
|
return count;
|
|
58
61
|
}
|
|
59
|
-
exports.countSetBits = countSetBits;
|
|
60
62
|
/** Helper function to get the value of a specific but in a binary representation of a number. */
|
|
61
63
|
function getKBitOfN(k, n) {
|
|
62
64
|
return (n >>> k) & 1;
|
|
63
65
|
}
|
|
64
|
-
exports.getKBitOfN = getKBitOfN;
|
|
65
66
|
/** Helper function to get the number of bits in a binary representation of a number. */
|
|
66
67
|
function getNumBitsOfN(n) {
|
|
67
68
|
let numBits = 0;
|
|
@@ -71,7 +72,6 @@ function getNumBitsOfN(n) {
|
|
|
71
72
|
}
|
|
72
73
|
return numBits;
|
|
73
74
|
}
|
|
74
|
-
exports.getNumBitsOfN = getNumBitsOfN;
|
|
75
75
|
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
76
76
|
function setToBitFlags(set) {
|
|
77
77
|
let flags = 0;
|
|
@@ -80,4 +80,3 @@ function setToBitFlags(set) {
|
|
|
80
80
|
}
|
|
81
81
|
return flags;
|
|
82
82
|
}
|
|
83
|
-
exports.setToBitFlags = setToBitFlags;
|