@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.
- package/dist/constructs.cjs +11 -4
- package/dist/constructs.js +11 -4
- package/package.json +1 -1
package/dist/constructs.cjs
CHANGED
|
@@ -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" ?
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
|
|
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/dist/constructs.js
CHANGED
|
@@ -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" ?
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
|
|
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;
|