libram 0.8.31 → 0.8.32

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.
@@ -116,10 +116,12 @@ export function differentiate(monster, ...combatParams) {
116
116
  export function differentiableQuantity(monster) {
117
117
  if (!have_($item `mimic egg`))
118
118
  return 0;
119
- const regex = new RegExp(`${monster.name}\\s*(?:\\((\\d+)\\))?`);
119
+ const regex = new RegExp(`<!-- monsterid: ${monster.id}-->(?:\\s\\((\\d+)\\))?`);
120
120
  const page = examine($item `mimic egg`);
121
121
  const match = page.match(regex);
122
122
  if (!match)
123
123
  return 0;
124
- return clamp(parseInt(match[1]), 0, availableAmount($item `mimic egg`)) || 1;
124
+ if (!match[1])
125
+ return 1;
126
+ return clamp(Number(match[1]), 1, availableAmount($item `mimic egg`));
125
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libram",
3
- "version": "0.8.31",
3
+ "version": "0.8.32",
4
4
  "description": "JavaScript helper library for KoLmafia",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",