@kar-mi/spirit-vale-tools-items 0.1.9 → 0.1.11

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/index.js CHANGED
@@ -39118,7 +39118,7 @@ function loadBundledItemCatalog(buildFingerprint = CURRENT_GAME_BUILD_FINGERPRIN
39118
39118
  }
39119
39119
  return {
39120
39120
  buildFingerprint: BUNDLED_CATALOG.buildFingerprint,
39121
- items: BUNDLED_CATALOG.items.map((item) => ({ ...item }))
39121
+ items: BUNDLED_CATALOG.items.map(cloneDefinition)
39122
39122
  };
39123
39123
  }
39124
39124
 
@@ -39130,7 +39130,7 @@ class FishNetItemDirectory {
39130
39130
  if (this.definitions.has(key)) {
39131
39131
  throw new Error(`duplicate item definition for type ${definition.itemType} ${JSON.stringify(definition.id)}`);
39132
39132
  }
39133
- this.definitions.set(key, definition);
39133
+ this.definitions.set(key, deepFreeze(cloneDefinition(definition)));
39134
39134
  }
39135
39135
  }
39136
39136
  resolve(itemType, itemId) {
@@ -39156,6 +39156,16 @@ function requireFishNetItem(itemType, itemId) {
39156
39156
  function itemKey(itemType, itemId) {
39157
39157
  return `${itemType}|${itemId}`;
39158
39158
  }
39159
+ function cloneDefinition(definition) {
39160
+ return structuredClone(definition);
39161
+ }
39162
+ function deepFreeze(value) {
39163
+ if (value === null || typeof value !== "object" || Object.isFrozen(value))
39164
+ return value;
39165
+ for (const nested of Object.values(value))
39166
+ deepFreeze(nested);
39167
+ return Object.freeze(value);
39168
+ }
39159
39169
  export {
39160
39170
  FishNetItemDirectory,
39161
39171
  loadBundledItemCatalog,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@kar-mi/spirit-vale-tools-items",
3
- "version": "0.1.9",
4
- "description": "Build-scoped Spirit Vale item catalog utilities.",
5
- "license": "AGPL-3.0-only",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/kar-mi/spirit-vale-tools.git",
9
- "directory": "packages/items"
10
- },
3
+ "version": "0.1.11",
4
+ "description": "Build-scoped Spirit Vale item catalog utilities.",
5
+ "license": "AGPL-3.0-only",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/kar-mi/spirit-vale-tools.git",
9
+ "directory": "packages/items"
10
+ },
11
11
  "type": "module",
12
12
  "files": [
13
13
  "dist",
@@ -23,6 +23,6 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@kar-mi/spirit-vale-tools-capture": "^2.2.0"
26
+ "@kar-mi/spirit-vale-tools-capture": "^3.0.1"
27
27
  }
28
28
  }
@@ -1,17 +0,0 @@
1
- import type { FishNetItemSubstatGroup } from "./catalog.ts";
2
- /** Maximum value a substat can reach at a perfect roll, keyed by stat type. */
3
- export type FishNetSubstatCaps = Readonly<Record<number, number>>;
4
- /** Substat caps for every pool the game rolls from, shared by the character and market readers. */
5
- export declare const SUBSTAT_CAPS: Readonly<Record<FishNetItemSubstatGroup, FishNetSubstatCaps>>;
6
- /** Equipment slot names in wire order. */
7
- export declare const EQUIP_SLOTS: readonly ["Main hand", "Off hand", "Head", "Legs", "Feet", "Chest", "Left accessory", "Right accessory", "Eyewear", "Back"];
8
- /**
9
- * Substat pool each equip slot rolls from. Weapon slots are absent because their pool depends on
10
- * the weapon rather than the slot; resolve those from the item's own `substatGroup`.
11
- */
12
- export declare const EQUIP_SLOT_SUBSTAT_GROUPS: Readonly<Record<number, FishNetItemSubstatGroup>>;
13
- /** Attribute substats (Str through Luk) share one cap across every pool. */
14
- export declare const ATTRIBUTE_SUBSTAT_CAP = 3;
15
- /** Mirrors Formula.GetSubstatScaledValue followed by Extensions.Round in the client. */
16
- export declare function substatScaledValue(cap: number, roll: number): number;
17
- //# sourceMappingURL=substat-caps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"substat-caps.d.ts","sourceRoot":"","sources":["../src/substat-caps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAsBlE,mGAAmG;AACnG,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAUtF,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,WAAW,YACtB,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EACxD,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAC9C,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CASvF,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpE"}