libram 0.10.0 → 0.10.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.
@@ -1,5 +1,5 @@
1
1
  import { Familiar } from "kolmafia";
2
- import { FamiliarTag } from "../../lib.js";
2
+ import { RegularFamiliarTag } from "../../lib.js";
3
3
  import { NumericModifier } from "../../modifierTypes.js";
4
4
  import { Modifiers } from "../../modifier.js";
5
5
  /**
@@ -30,8 +30,7 @@ export declare function currentDistillateModifiers(): Modifiers<NumericModifier>
30
30
  * @returns the modifier value for the given modifier
31
31
  */
32
32
  export declare function distillateModifier(modifier: NumericModifier): number;
33
- type StillsuitTag = Exclude<FamiliarTag, "pokefam">;
34
- export declare const MODIFIER_TAGS: Record<StillsuitTag, NumericModifier>;
33
+ export declare const MODIFIER_TAGS: Record<RegularFamiliarTag, NumericModifier>;
35
34
  /**
36
35
  * Calculate the ratio of stillsuit modifiers for a particular familiar.
37
36
  * @param familiar The familiar in question
@@ -44,4 +43,3 @@ export declare function modifierRatio(familiar: Familiar): Modifiers<NumericModi
44
43
  * @returns The familiar you currently `have` that returns the best stillsuit distillate for that modifier.
45
44
  */
46
45
  export declare function bestFamiliar(modifier: NumericModifier): Familiar;
47
- export {};
@@ -1,5 +1,5 @@
1
1
  import { cliExecute, Familiar, splitModifiers, visitUrl } from "kolmafia";
2
- import { getFamiliarTags, have as have_ } from "../../lib.js";
2
+ import { getAllFamiliarTags, have as have_, isRegularFamiliarTag, } from "../../lib.js";
3
3
  import { get } from "../../property.js";
4
4
  import { $item } from "../../template-string.js";
5
5
  import { parseModifiers } from "../../modifier.js";
@@ -102,17 +102,14 @@ export const MODIFIER_TAGS = Object.freeze({
102
102
  hasstinger: "Weapon Damage",
103
103
  hard: "Weapon Damage",
104
104
  });
105
- function isStillsuitTag(tag) {
106
- return tag in MODIFIER_TAGS;
107
- }
108
105
  /**
109
106
  * Calculate the ratio of stillsuit modifiers for a particular familiar.
110
107
  * @param familiar The familiar in question
111
108
  * @returns An object whose keys are NumericModifiers potentially granted by the stillsuit distillate from this familiar, and whose values are the relative weights of those modifiers
112
109
  */
113
110
  export function modifierRatio(familiar) {
114
- const tags = getFamiliarTags(familiar);
115
- return tags.filter(isStillsuitTag).reduce((acc, tag) => ({
111
+ const tags = getAllFamiliarTags(familiar);
112
+ return tags.filter(isRegularFamiliarTag).reduce((acc, tag) => ({
116
113
  ...acc,
117
114
  [MODIFIER_TAGS[tag]]: (acc[MODIFIER_TAGS[tag]] ?? 0) + 1 / tags.length,
118
115
  }), {});
@@ -29,6 +29,7 @@ import * as Pantogram from "./2017/Pantogram.js";
29
29
  import * as Robortender from "./2017/Robortender.js";
30
30
  import * as Spacegate from "./2017/Spacegate.js";
31
31
  import * as TunnelOfLove from "./2017/TunnelOfLove.js";
32
+ import * as BoxingDaycare from "./2018/BoxingDaycare.js";
32
33
  import * as Latte from "./2018/LatteLoversMembersMug.js";
33
34
  import * as SongBoom from "./2018/SongBoom.js";
34
35
  import * as BeachComb from "./2019/BeachComb.js";
@@ -61,6 +62,6 @@ import * as TakerSpace from "./2024/TakerSpace.js";
61
62
  import * as CrepeParachute from "./2025/CrepeParachute.js";
62
63
  import * as ToyCupidBow from "./2025/ToyCupidBow.js";
63
64
  import * as Raffle from "./evergreen/Raffle.js";
64
- export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BatWings, BeachComb, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CommaChameleon, ConspiracyIsland, CrepeParachute, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, EverfullDarts, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayamCalendar, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, PocketProfessor, RainDoh, Raffle, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StillSuit, StompingBoots, TakerSpace, TearawayPants, ToyCupidBow, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
65
+ export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BatWings, BeachComb, BoxingDaycare, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CommaChameleon, ConspiracyIsland, CrepeParachute, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, EverfullDarts, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayamCalendar, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, PocketProfessor, RainDoh, Raffle, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StillSuit, StompingBoots, TakerSpace, TearawayPants, ToyCupidBow, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
65
66
  export * from "./putty-likes.js";
66
67
  export * from "./LibramSummon.js";
@@ -29,6 +29,7 @@ import * as Pantogram from "./2017/Pantogram.js";
29
29
  import * as Robortender from "./2017/Robortender.js";
30
30
  import * as Spacegate from "./2017/Spacegate.js";
31
31
  import * as TunnelOfLove from "./2017/TunnelOfLove.js";
32
+ import * as BoxingDaycare from "./2018/BoxingDaycare.js";
32
33
  import * as Latte from "./2018/LatteLoversMembersMug.js";
33
34
  import * as SongBoom from "./2018/SongBoom.js";
34
35
  import * as BeachComb from "./2019/BeachComb.js";
@@ -61,6 +62,6 @@ import * as TakerSpace from "./2024/TakerSpace.js";
61
62
  import * as CrepeParachute from "./2025/CrepeParachute.js";
62
63
  import * as ToyCupidBow from "./2025/ToyCupidBow.js";
63
64
  import * as Raffle from "./evergreen/Raffle.js";
64
- export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BatWings, BeachComb, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CommaChameleon, ConspiracyIsland, CrepeParachute, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, EverfullDarts, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayamCalendar, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, PocketProfessor, RainDoh, Raffle, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StillSuit, StompingBoots, TakerSpace, TearawayPants, ToyCupidBow, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
65
+ export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BatWings, BeachComb, BoxingDaycare, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CommaChameleon, ConspiracyIsland, CrepeParachute, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, EverfullDarts, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayamCalendar, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, PocketProfessor, RainDoh, Raffle, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StillSuit, StompingBoots, TakerSpace, TearawayPants, ToyCupidBow, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
65
66
  export * from "./putty-likes.js";
66
67
  export * from "./LibramSummon.js";
package/dist/utils.d.ts CHANGED
@@ -190,4 +190,5 @@ type Enumerate<N extends number, A extends number[] = []> = A["length"] extends
190
190
  * Integers on the interval [A, B).
191
191
  */
192
192
  export type Range<A extends number, B extends number> = Exclude<Enumerate<B>, Enumerate<A>>;
193
+ export type ValueOf<T> = T[keyof T];
193
194
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libram",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "JavaScript helper library for KoLmafia",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",