@optique/core 1.0.0-dev.1661 → 1.0.0-dev.1663

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.
@@ -1333,10 +1333,17 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
1333
1333
  const createFieldStateGetter = (parentState, annotateChildState = getAnnotatedChildState) => {
1334
1334
  return (field, parser) => {
1335
1335
  const fieldKey = field;
1336
- const cache = parentState != null && typeof parentState === "object" ? inheritedFieldStateCache.get(parentState) ?? (() => {
1337
- const stateCache = /* @__PURE__ */ new Map();
1338
- inheritedFieldStateCache.set(parentState, stateCache);
1339
- return stateCache;
1336
+ const cache = parentState != null && typeof parentState === "object" ? (() => {
1337
+ const annotatorCaches = inheritedFieldStateCache.get(parentState) ?? (() => {
1338
+ const nextCaches = /* @__PURE__ */ new WeakMap();
1339
+ inheritedFieldStateCache.set(parentState, nextCaches);
1340
+ return nextCaches;
1341
+ })();
1342
+ return annotatorCaches.get(annotateChildState) ?? (() => {
1343
+ const stateCache = /* @__PURE__ */ new Map();
1344
+ annotatorCaches.set(annotateChildState, stateCache);
1345
+ return stateCache;
1346
+ })();
1340
1347
  })() : void 0;
1341
1348
  if (cache?.has(fieldKey)) return cache.get(fieldKey);
1342
1349
  const sourceState = parentState != null && typeof parentState === "object" && fieldKey in parentState ? parentState[fieldKey] : parser.initialState;
@@ -1333,10 +1333,17 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
1333
1333
  const createFieldStateGetter = (parentState, annotateChildState = getAnnotatedChildState) => {
1334
1334
  return (field, parser) => {
1335
1335
  const fieldKey = field;
1336
- const cache = parentState != null && typeof parentState === "object" ? inheritedFieldStateCache.get(parentState) ?? (() => {
1337
- const stateCache = /* @__PURE__ */ new Map();
1338
- inheritedFieldStateCache.set(parentState, stateCache);
1339
- return stateCache;
1336
+ const cache = parentState != null && typeof parentState === "object" ? (() => {
1337
+ const annotatorCaches = inheritedFieldStateCache.get(parentState) ?? (() => {
1338
+ const nextCaches = /* @__PURE__ */ new WeakMap();
1339
+ inheritedFieldStateCache.set(parentState, nextCaches);
1340
+ return nextCaches;
1341
+ })();
1342
+ return annotatorCaches.get(annotateChildState) ?? (() => {
1343
+ const stateCache = /* @__PURE__ */ new Map();
1344
+ annotatorCaches.set(annotateChildState, stateCache);
1345
+ return stateCache;
1346
+ })();
1340
1347
  })() : void 0;
1341
1348
  if (cache?.has(fieldKey)) return cache.get(fieldKey);
1342
1349
  const sourceState = parentState != null && typeof parentState === "object" && fieldKey in parentState ? parentState[fieldKey] : parser.initialState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1661+6fc17d4f",
3
+ "version": "1.0.0-dev.1663+381b3156",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",