@kar-mi/spirit-vale-tools-items 0.1.10 → 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.
Files changed (2) hide show
  1. package/dist/index.js +12 -2
  2. package/package.json +2 -2
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@kar-mi/spirit-vale-tools-items",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Build-scoped Spirit Vale item catalog utilities.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -23,6 +23,6 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@kar-mi/spirit-vale-tools-capture": "^3.0.0"
26
+ "@kar-mi/spirit-vale-tools-capture": "^3.0.1"
27
27
  }
28
28
  }