libram 0.11.15 → 0.11.17
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/dist/{src/modifier.d.ts → modifier.d.ts} +11 -0
- package/dist/{src/modifier.js → modifier.js} +11 -1
- package/dist/{src/propertyTypes.d.ts → propertyTypes.d.ts} +3 -3
- package/dist/{src/propertyTypes.js → propertyTypes.js} +3 -3
- package/dist/{src/resources → resources}/2015/ChateauMantegna.d.ts +4 -0
- package/dist/{src/resources → resources}/2015/ChateauMantegna.js +20 -0
- package/dist/resources/2026/EternityCodpiece.d.ts +23 -0
- package/dist/resources/2026/EternityCodpiece.js +33 -0
- package/dist/{src/resources → resources}/index.d.ts +2 -1
- package/dist/{src/resources → resources}/index.js +2 -1
- package/package.json +1 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/setupTests.js +0 -88
- /package/dist/{src/Clan.d.ts → Clan.d.ts} +0 -0
- /package/dist/{src/Clan.js → Clan.js} +0 -0
- /package/dist/{src/Copier.d.ts → Copier.d.ts} +0 -0
- /package/dist/{src/Copier.js → Copier.js} +0 -0
- /package/dist/{src/Dungeon.d.ts → Dungeon.d.ts} +0 -0
- /package/dist/{src/Dungeon.js → Dungeon.js} +0 -0
- /package/dist/{src/Kmail.d.ts → Kmail.d.ts} +0 -0
- /package/dist/{src/Kmail.js → Kmail.js} +0 -0
- /package/dist/{src/Kmail.test.d.ts → Kmail.test.d.ts} +0 -0
- /package/dist/{src/Kmail.test.js → Kmail.test.js} +0 -0
- /package/dist/{src/Macro.test.d.ts → Macro.test.d.ts} +0 -0
- /package/dist/{src/Macro.test.js → Macro.test.js} +0 -0
- /package/dist/{src/actions → actions}/ActionSource.d.ts +0 -0
- /package/dist/{src/actions → actions}/ActionSource.js +0 -0
- /package/dist/{src/actions → actions}/Banish.d.ts +0 -0
- /package/dist/{src/actions → actions}/Banish.js +0 -0
- /package/dist/{src/actions → actions}/FreeKill.d.ts +0 -0
- /package/dist/{src/actions → actions}/FreeKill.js +0 -0
- /package/dist/{src/actions → actions}/FreeRun.d.ts +0 -0
- /package/dist/{src/actions → actions}/FreeRun.js +0 -0
- /package/dist/{src/actions → actions}/index.d.ts +0 -0
- /package/dist/{src/actions → actions}/index.js +0 -0
- /package/dist/{src/ascend.d.ts → ascend.d.ts} +0 -0
- /package/dist/{src/ascend.js → ascend.js} +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2014/HeavyRains.d.ts +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2014/HeavyRains.js +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2015/CommunityService.d.ts +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2015/CommunityService.js +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2016/NuclearAutumn.d.ts +0 -0
- /package/dist/{src/challengePaths → challengePaths}/2016/NuclearAutumn.js +0 -0
- /package/dist/{src/challengePaths → challengePaths}/index.d.ts +0 -0
- /package/dist/{src/challengePaths → challengePaths}/index.js +0 -0
- /package/dist/{src/combat.d.ts → combat.d.ts} +0 -0
- /package/dist/{src/combat.js → combat.js} +0 -0
- /package/dist/{src/console.d.ts → console.d.ts} +0 -0
- /package/dist/{src/console.js → console.js} +0 -0
- /package/dist/{src/counter.d.ts → counter.d.ts} +0 -0
- /package/dist/{src/counter.js → counter.js} +0 -0
- /package/dist/{src/diet → diet}/index.d.ts +0 -0
- /package/dist/{src/diet → diet}/index.js +0 -0
- /package/dist/{src/diet → diet}/knapsack.d.ts +0 -0
- /package/dist/{src/diet → diet}/knapsack.js +0 -0
- /package/dist/{src/diet → diet}/knapsack.test.d.ts +0 -0
- /package/dist/{src/diet → diet}/knapsack.test.js +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/lib.d.ts → lib.d.ts} +0 -0
- /package/dist/{src/lib.js → lib.js} +0 -0
- /package/dist/{src/lib.test.d.ts → lib.test.d.ts} +0 -0
- /package/dist/{src/lib.test.js → lib.test.js} +0 -0
- /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
- /package/dist/{src/logger.js → logger.js} +0 -0
- /package/dist/{src/maximize.d.ts → maximize.d.ts} +0 -0
- /package/dist/{src/maximize.js → maximize.js} +0 -0
- /package/dist/{src/mining.d.ts → mining.d.ts} +0 -0
- /package/dist/{src/mining.js → mining.js} +0 -0
- /package/dist/{src/modifierTypes.d.ts → modifierTypes.d.ts} +0 -0
- /package/dist/{src/modifierTypes.js → modifierTypes.js} +0 -0
- /package/dist/{src/mood.d.ts → mood.d.ts} +0 -0
- /package/dist/{src/mood.js → mood.js} +0 -0
- /package/dist/{src/moonSign.d.ts → moonSign.d.ts} +0 -0
- /package/dist/{src/moonSign.js → moonSign.js} +0 -0
- /package/dist/{src/overlappingNames.d.ts → overlappingNames.d.ts} +0 -0
- /package/dist/{src/overlappingNames.js → overlappingNames.js} +0 -0
- /package/dist/{src/property.d.ts → property.d.ts} +0 -0
- /package/dist/{src/property.js → property.js} +0 -0
- /package/dist/{src/propertyTyping.d.ts → propertyTyping.d.ts} +0 -0
- /package/dist/{src/propertyTyping.js → propertyTyping.js} +0 -0
- /package/dist/{src/resources → resources}/2006/CommaChameleon.d.ts +0 -0
- /package/dist/{src/resources → resources}/2006/CommaChameleon.js +0 -0
- /package/dist/{src/resources → resources}/2007/CandyHearts.d.ts +0 -0
- /package/dist/{src/resources → resources}/2007/CandyHearts.js +0 -0
- /package/dist/{src/resources → resources}/2008/DivineFavors.d.ts +0 -0
- /package/dist/{src/resources → resources}/2008/DivineFavors.js +0 -0
- /package/dist/{src/resources → resources}/2008/Stickers.d.ts +0 -0
- /package/dist/{src/resources → resources}/2008/Stickers.js +0 -0
- /package/dist/{src/resources → resources}/2009/Bandersnatch.d.ts +0 -0
- /package/dist/{src/resources → resources}/2009/Bandersnatch.js +0 -0
- /package/dist/{src/resources → resources}/2009/LoveSongs.d.ts +0 -0
- /package/dist/{src/resources → resources}/2009/LoveSongs.js +0 -0
- /package/dist/{src/resources → resources}/2009/SpookyPutty.d.ts +0 -0
- /package/dist/{src/resources → resources}/2009/SpookyPutty.js +0 -0
- /package/dist/{src/resources → resources}/2010/Brickos.d.ts +0 -0
- /package/dist/{src/resources → resources}/2010/Brickos.js +0 -0
- /package/dist/{src/resources → resources}/2010/CrownOfThrones.d.ts +0 -0
- /package/dist/{src/resources → resources}/2010/CrownOfThrones.js +0 -0
- /package/dist/{src/resources → resources}/2010/LookingGlass.d.ts +0 -0
- /package/dist/{src/resources → resources}/2010/LookingGlass.js +0 -0
- /package/dist/{src/resources → resources}/2011/Gygaxian.d.ts +0 -0
- /package/dist/{src/resources → resources}/2011/Gygaxian.js +0 -0
- /package/dist/{src/resources → resources}/2011/ObtuseAngel.d.ts +0 -0
- /package/dist/{src/resources → resources}/2011/ObtuseAngel.js +0 -0
- /package/dist/{src/resources → resources}/2011/StompingBoots.d.ts +0 -0
- /package/dist/{src/resources → resources}/2011/StompingBoots.js +0 -0
- /package/dist/{src/resources → resources}/2012/RainDoh.d.ts +0 -0
- /package/dist/{src/resources → resources}/2012/RainDoh.js +0 -0
- /package/dist/{src/resources → resources}/2012/ReagnimatedGnome.d.ts +0 -0
- /package/dist/{src/resources → resources}/2012/ReagnimatedGnome.js +0 -0
- /package/dist/{src/resources → resources}/2012/Resolutions.d.ts +0 -0
- /package/dist/{src/resources → resources}/2012/Resolutions.js +0 -0
- /package/dist/{src/resources → resources}/2013/Florist.d.ts +0 -0
- /package/dist/{src/resources → resources}/2013/Florist.js +0 -0
- /package/dist/{src/resources → resources}/2013/JungMan.d.ts +0 -0
- /package/dist/{src/resources → resources}/2013/JungMan.js +0 -0
- /package/dist/{src/resources → resources}/2013/PulledTaffy.d.ts +0 -0
- /package/dist/{src/resources → resources}/2013/PulledTaffy.js +0 -0
- /package/dist/{src/resources → resources}/2014/ConspiracyIsland.d.ts +0 -0
- /package/dist/{src/resources → resources}/2014/ConspiracyIsland.js +0 -0
- /package/dist/{src/resources → resources}/2014/CrimboShrub.d.ts +0 -0
- /package/dist/{src/resources → resources}/2014/CrimboShrub.js +0 -0
- /package/dist/{src/resources → resources}/2014/DNALab.d.ts +0 -0
- /package/dist/{src/resources → resources}/2014/DNALab.js +0 -0
- /package/dist/{src/resources → resources}/2014/WinterGarden.d.ts +0 -0
- /package/dist/{src/resources → resources}/2014/WinterGarden.js +0 -0
- /package/dist/{src/resources → resources}/2015/BarrelShrine.d.ts +0 -0
- /package/dist/{src/resources → resources}/2015/BarrelShrine.js +0 -0
- /package/dist/{src/resources → resources}/2015/DeckOfEveryCard.d.ts +0 -0
- /package/dist/{src/resources → resources}/2015/DeckOfEveryCard.js +0 -0
- /package/dist/{src/resources → resources}/2015/Dinseylandfill.d.ts +0 -0
- /package/dist/{src/resources → resources}/2015/Dinseylandfill.js +0 -0
- /package/dist/{src/resources → resources}/2015/MayoClinic.d.ts +0 -0
- /package/dist/{src/resources → resources}/2015/MayoClinic.js +0 -0
- /package/dist/{src/resources → resources}/2016/GingerBread.d.ts +0 -0
- /package/dist/{src/resources → resources}/2016/GingerBread.js +0 -0
- /package/dist/{src/resources → resources}/2016/SourceTerminal.d.ts +0 -0
- /package/dist/{src/resources → resources}/2016/SourceTerminal.js +0 -0
- /package/dist/{src/resources → resources}/2016/Witchess.d.ts +0 -0
- /package/dist/{src/resources → resources}/2016/Witchess.js +0 -0
- /package/dist/{src/resources → resources}/2017/AsdonMartin.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/AsdonMartin.js +0 -0
- /package/dist/{src/resources → resources}/2017/Horsery.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/Horsery.js +0 -0
- /package/dist/{src/resources → resources}/2017/MummingTrunk.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/MummingTrunk.js +0 -0
- /package/dist/{src/resources → resources}/2017/Pantogram.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/Pantogram.js +0 -0
- /package/dist/{src/resources → resources}/2017/Robortender.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/Robortender.js +0 -0
- /package/dist/{src/resources → resources}/2017/Spacegate.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/Spacegate.js +0 -0
- /package/dist/{src/resources → resources}/2017/TunnelOfLove.d.ts +0 -0
- /package/dist/{src/resources → resources}/2017/TunnelOfLove.js +0 -0
- /package/dist/{src/resources → resources}/2018/BoxingDaycare.d.ts +0 -0
- /package/dist/{src/resources → resources}/2018/BoxingDaycare.js +0 -0
- /package/dist/{src/resources → resources}/2018/LatteLoversMembersMug.d.ts +0 -0
- /package/dist/{src/resources → resources}/2018/LatteLoversMembersMug.js +0 -0
- /package/dist/{src/resources → resources}/2018/SongBoom.d.ts +0 -0
- /package/dist/{src/resources → resources}/2018/SongBoom.js +0 -0
- /package/dist/{src/resources → resources}/2019/BeachComb.d.ts +0 -0
- /package/dist/{src/resources → resources}/2019/BeachComb.js +0 -0
- /package/dist/{src/resources → resources}/2019/CampAway.d.ts +0 -0
- /package/dist/{src/resources → resources}/2019/CampAway.js +0 -0
- /package/dist/{src/resources → resources}/2019/PocketProfessor.d.ts +0 -0
- /package/dist/{src/resources → resources}/2019/PocketProfessor.js +0 -0
- /package/dist/{src/resources → resources}/2019/Snapper.d.ts +0 -0
- /package/dist/{src/resources → resources}/2019/Snapper.js +0 -0
- /package/dist/{src/resources → resources}/2020/Cartography.d.ts +0 -0
- /package/dist/{src/resources → resources}/2020/Cartography.js +0 -0
- /package/dist/{src/resources → resources}/2020/Guzzlr.d.ts +0 -0
- /package/dist/{src/resources → resources}/2020/Guzzlr.js +0 -0
- /package/dist/{src/resources → resources}/2020/RetroCape.d.ts +0 -0
- /package/dist/{src/resources → resources}/2020/RetroCape.js +0 -0
- /package/dist/{src/resources → resources}/2021/CrystalBall.d.ts +0 -0
- /package/dist/{src/resources → resources}/2021/CrystalBall.js +0 -0
- /package/dist/{src/resources → resources}/2021/DaylightShavings.d.ts +0 -0
- /package/dist/{src/resources → resources}/2021/DaylightShavings.js +0 -0
- /package/dist/{src/resources → resources}/2022/AutumnAton.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/AutumnAton.js +0 -0
- /package/dist/{src/resources → resources}/2022/CombatLoversLocket.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/CombatLoversLocket.js +0 -0
- /package/dist/{src/resources → resources}/2022/DesignerSweatpants.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/DesignerSweatpants.js +0 -0
- /package/dist/{src/resources → resources}/2022/GreyGoose.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/GreyGoose.js +0 -0
- /package/dist/{src/resources → resources}/2022/JuneCleaver.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/JuneCleaver.js +0 -0
- /package/dist/{src/resources → resources}/2022/Stillsuit.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/Stillsuit.js +0 -0
- /package/dist/{src/resources → resources}/2022/TrainSet.d.ts +0 -0
- /package/dist/{src/resources → resources}/2022/TrainSet.js +0 -0
- /package/dist/{src/resources → resources}/2023/AugustScepter.d.ts +0 -0
- /package/dist/{src/resources → resources}/2023/AugustScepter.js +0 -0
- /package/dist/{src/resources → resources}/2023/BurningLeaves.d.ts +0 -0
- /package/dist/{src/resources → resources}/2023/BurningLeaves.js +0 -0
- /package/dist/{src/resources → resources}/2023/CinchoDeMayo.d.ts +0 -0
- /package/dist/{src/resources → resources}/2023/CinchoDeMayo.js +0 -0
- /package/dist/{src/resources → resources}/2023/ClosedCircuitPayphone.d.ts +0 -0
- /package/dist/{src/resources → resources}/2023/ClosedCircuitPayphone.js +0 -0
- /package/dist/{src/resources → resources}/2023/CursedMonkeyPaw.d.ts +0 -0
- /package/dist/{src/resources → resources}/2023/CursedMonkeyPaw.js +0 -0
- /package/dist/{src/resources → resources}/2024/AprilingBandHelmet.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/AprilingBandHelmet.js +0 -0
- /package/dist/{src/resources → resources}/2024/BatWings.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/BatWings.js +0 -0
- /package/dist/{src/resources → resources}/2024/ChestMimic.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/ChestMimic.js +0 -0
- /package/dist/{src/resources → resources}/2024/EverfullDarts.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/EverfullDarts.js +0 -0
- /package/dist/{src/resources → resources}/2024/MayamCalendar.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/MayamCalendar.js +0 -0
- /package/dist/{src/resources → resources}/2024/TakerSpace.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/TakerSpace.js +0 -0
- /package/dist/{src/resources → resources}/2024/TearawayPants.d.ts +0 -0
- /package/dist/{src/resources → resources}/2024/TearawayPants.js +0 -0
- /package/dist/{src/resources → resources}/2025/BloodCubicZirconia.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/BloodCubicZirconia.js +0 -0
- /package/dist/{src/resources → resources}/2025/CrepeParachute.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/CrepeParachute.js +0 -0
- /package/dist/{src/resources → resources}/2025/CyberRealm.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/CyberRealm.js +0 -0
- /package/dist/{src/resources → resources}/2025/Leprecondo.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/Leprecondo.js +0 -0
- /package/dist/{src/resources → resources}/2025/PeridotOfPeril.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/PeridotOfPeril.js +0 -0
- /package/dist/{src/resources → resources}/2025/PrismaticBeret.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/PrismaticBeret.js +0 -0
- /package/dist/{src/resources → resources}/2025/SkeletonOfCrimboPast.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/SkeletonOfCrimboPast.js +0 -0
- /package/dist/{src/resources → resources}/2025/ToyCupidBow.d.ts +0 -0
- /package/dist/{src/resources → resources}/2025/ToyCupidBow.js +0 -0
- /package/dist/{src/resources → resources}/2026/LegendarySealClubbingClub.d.ts +0 -0
- /package/dist/{src/resources → resources}/2026/LegendarySealClubbingClub.js +0 -0
- /package/dist/{src/resources → resources}/LibramSummon.d.ts +0 -0
- /package/dist/{src/resources → resources}/LibramSummon.js +0 -0
- /package/dist/{src/resources → resources}/evergreen/Raffle.d.ts +0 -0
- /package/dist/{src/resources → resources}/evergreen/Raffle.js +0 -0
- /package/dist/{src/resources → resources}/evergreen/Raffle.test.d.ts +0 -0
- /package/dist/{src/resources → resources}/evergreen/Raffle.test.js +0 -0
- /package/dist/{src/resources → resources}/putty-likes.d.ts +0 -0
- /package/dist/{src/resources → resources}/putty-likes.js +0 -0
- /package/dist/{src/session.d.ts → session.d.ts} +0 -0
- /package/dist/{src/session.js → session.js} +0 -0
- /package/dist/{src/since.d.ts → since.d.ts} +0 -0
- /package/dist/{src/since.js → since.js} +0 -0
- /package/dist/{src/template-string.d.ts → template-string.d.ts} +0 -0
- /package/dist/{src/template-string.js → template-string.js} +0 -0
- /package/dist/{src/url.d.ts → url.d.ts} +0 -0
- /package/dist/{src/url.js → url.js} +0 -0
- /package/dist/{src/url.test.d.ts → url.test.d.ts} +0 -0
- /package/dist/{src/url.test.js → url.test.js} +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
- /package/dist/{src/utils.js → utils.js} +0 -0
- /package/dist/{src/utils.test.d.ts → utils.test.d.ts} +0 -0
- /package/dist/{src/utils.test.js → utils.test.js} +0 -0
|
@@ -70,6 +70,7 @@ import * as PrismaticBeret from "./2025/PrismaticBeret.js";
|
|
|
70
70
|
import * as BloodCubicZirconia from "./2025/BloodCubicZirconia.js";
|
|
71
71
|
import * as SkeletonOfCrimboPast from "./2025/SkeletonOfCrimboPast.js";
|
|
72
72
|
import * as LegendarySealClubbingClub from "./2026/LegendarySealClubbingClub.js";
|
|
73
|
-
|
|
73
|
+
import * as EternityCodpiece from "./2026/EternityCodpiece.js";
|
|
74
|
+
export { AprilingBandHelmet, AsdonMartin, AugustScepter, AutumnAton, Bandersnatch, BarrelShrine, BatWings, BeachComb, BloodCubicZirconia, BoxingDaycare, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CommaChameleon, ConspiracyIsland, CrepeParachute, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, CyberRealm, DaylightShavings, DeckOfEveryCard, DesignerSweatpants, Dinseylandfill, DNALab, EternityCodpiece, EverfullDarts, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LegendarySealClubbingClub, Leprecondo, LookingGlass, MayamCalendar, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, PeridotOfPeril, PocketProfessor, PrismaticBeret, Raffle, RainDoh, ReagnimatedGnome, RetroCape, Robortender, SkeletonOfCrimboPast, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StillSuit, StompingBoots, TakerSpace, TearawayPants, ToyCupidBow, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
|
|
74
75
|
export * from "./putty-likes.js";
|
|
75
76
|
export * from "./LibramSummon.js";
|
package/package.json
CHANGED
package/dist/setupTests.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const clearMockProperties: () => void;
|
package/dist/setupTests.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { decodeHTML } from "entities";
|
|
2
|
-
import * as kolmafia from "kolmafia";
|
|
3
|
-
import { vi } from "vitest";
|
|
4
|
-
vi.mock("kolmafia");
|
|
5
|
-
function mockOneOrMany(ctor, n, knownInstances) {
|
|
6
|
-
function mockOne(name) {
|
|
7
|
-
// to make mocking easier, we'll just tread ids as names
|
|
8
|
-
if (typeof name === "number") {
|
|
9
|
-
name = `[${name.toString()}]`;
|
|
10
|
-
}
|
|
11
|
-
const existingInstance = knownInstances.find((i) => i.name === name);
|
|
12
|
-
if (existingInstance) {
|
|
13
|
-
return existingInstance;
|
|
14
|
-
}
|
|
15
|
-
const instance = new ctor(name);
|
|
16
|
-
knownInstances.push(instance);
|
|
17
|
-
return instance;
|
|
18
|
-
}
|
|
19
|
-
if (Array.isArray(n)) {
|
|
20
|
-
return n.map((name) => mockOne(name));
|
|
21
|
-
}
|
|
22
|
-
return mockOne(n);
|
|
23
|
-
}
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
const knownInstances = {};
|
|
26
|
-
const knownIds = {};
|
|
27
|
-
// Mock all of the MafiaClasses
|
|
28
|
-
for (const [key, value] of Object.entries(kolmafia)) {
|
|
29
|
-
if (typeof value !== "function") {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
// Let's take the existence of a none static to be proof of being a MafiaClass
|
|
33
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, "prototype");
|
|
34
|
-
if (!descriptor?.value.constructor.none) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
const mockedClass = vi.mocked(kolmafia)[key];
|
|
38
|
-
if (!("prototype" in mockedClass) || !("get" in mockedClass))
|
|
39
|
-
continue;
|
|
40
|
-
knownInstances[key] = [];
|
|
41
|
-
knownIds[key] = 11;
|
|
42
|
-
vi.mocked(mockedClass.prototype.constructor).mockImplementation(function (name) {
|
|
43
|
-
const self = this;
|
|
44
|
-
self.name = name;
|
|
45
|
-
self.id = knownIds[key]++;
|
|
46
|
-
});
|
|
47
|
-
mockedClass.prototype.toString = function () {
|
|
48
|
-
return this.name;
|
|
49
|
-
};
|
|
50
|
-
vi.mocked(mockedClass.get).mockImplementation(((n) =>
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
-
mockOneOrMany(mockedClass, n, knownInstances[key])));
|
|
53
|
-
vi.mocked(mockedClass.all).mockImplementation(() => knownInstances[key]);
|
|
54
|
-
}
|
|
55
|
-
function findItemByPlural(plural) {
|
|
56
|
-
return knownInstances["Item"].find((i) => i.plural === plural);
|
|
57
|
-
}
|
|
58
|
-
vi.mocked(kolmafia).logprint.mockImplementation((msg) => console.log(`[kolmafia.logprint] ${msg}`));
|
|
59
|
-
vi.mocked(kolmafia).print.mockImplementation((msg) => console.log(`[kolmafia.print] ${msg}`));
|
|
60
|
-
vi.mocked(kolmafia).printHtml.mockImplementation((msg) => console.log(`[kolmafia.printHtml] ${msg}`));
|
|
61
|
-
vi.mocked(kolmafia).extractItems.mockImplementation((s) => {
|
|
62
|
-
const items = {};
|
|
63
|
-
for (const match of s.matchAll(/You acquire an item: <b>([^<]+)<\/b>/g)) {
|
|
64
|
-
const name = decodeHTML(match[1]);
|
|
65
|
-
items[name] = (items[name] ?? 0) + 1;
|
|
66
|
-
}
|
|
67
|
-
for (const match of s.matchAll(/You acquire <b>(\d+) ([^<]+)<\/b>/g)) {
|
|
68
|
-
const count = parseInt(match[1], 10);
|
|
69
|
-
const plural = decodeHTML(match[2]);
|
|
70
|
-
const item = findItemByPlural(plural) ?? kolmafia.Item.get(plural);
|
|
71
|
-
const name = item.name;
|
|
72
|
-
items[name] = (items[name] ?? 0) + count;
|
|
73
|
-
}
|
|
74
|
-
return items;
|
|
75
|
-
});
|
|
76
|
-
vi.mocked(kolmafia).extractMeat.mockImplementation((s) => {
|
|
77
|
-
const match = /You gain (\d+) Meat/.exec(s);
|
|
78
|
-
return match ? parseInt(match[1], 10) : 0;
|
|
79
|
-
});
|
|
80
|
-
vi.mocked(kolmafia).getMonsters.mockImplementation(() => []);
|
|
81
|
-
vi.mocked(kolmafia).nowToString.mockImplementation(() => new Date().toISOString());
|
|
82
|
-
vi.mocked(kolmafia).toInt.mockImplementation((value) => parseInt(value.toString(), 10));
|
|
83
|
-
vi.mocked(kolmafia).toPlural.mockImplementation((item) => item.plural);
|
|
84
|
-
vi.mocked(kolmafia).toString.mockImplementation((value) => value.toString());
|
|
85
|
-
const mockProperties = new Map();
|
|
86
|
-
export const clearMockProperties = () => mockProperties.clear();
|
|
87
|
-
vi.mocked(kolmafia).getProperty.mockImplementation((key) => mockProperties.get(key) ?? "");
|
|
88
|
-
vi.mocked(kolmafia).setProperty.mockImplementation((key, value) => mockProperties.set(key, value));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|