@optique/core 1.0.0-dev.1787 → 1.0.0-dev.1789
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/annotation-state.cjs +12 -0
- package/dist/annotation-state.js +13 -2
- package/dist/constructs.cjs +1 -3
- package/dist/constructs.js +2 -4
- package/package.json +1 -1
|
@@ -90,6 +90,17 @@ function getWrappedChildState(parentState, childState, parser) {
|
|
|
90
90
|
}
|
|
91
91
|
return withAnnotationView(childState, annotations);
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Reconciles object-owned child state with parent annotations using the same
|
|
95
|
+
* shared object-state inheritance rule across parser families.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
function reconcileObjectChildState(parentState, childState) {
|
|
100
|
+
const annotations = require_annotations.getAnnotations(parentState);
|
|
101
|
+
if (annotations === void 0 || childState == null || typeof childState !== "object" || require_annotations.getAnnotations(childState) === annotations) return childState;
|
|
102
|
+
return require_annotations.inheritAnnotations(parentState, childState);
|
|
103
|
+
}
|
|
93
104
|
|
|
94
105
|
//#endregion
|
|
95
106
|
exports.annotationViewTargets = annotationViewTargets;
|
|
@@ -97,4 +108,5 @@ exports.getWrappedChildParseState = getWrappedChildParseState;
|
|
|
97
108
|
exports.getWrappedChildState = getWrappedChildState;
|
|
98
109
|
exports.isAnnotationWrappedInitialState = isAnnotationWrappedInitialState;
|
|
99
110
|
exports.normalizeInjectedAnnotationState = normalizeInjectedAnnotationState;
|
|
111
|
+
exports.reconcileObjectChildState = reconcileObjectChildState;
|
|
100
112
|
exports.unwrapAnnotationView = unwrapAnnotationView;
|
package/dist/annotation-state.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { annotationKey, getAnnotations, injectAnnotations, unwrapInjectedAnnotationWrapper } from "./annotations.js";
|
|
1
|
+
import { annotationKey, getAnnotations, inheritAnnotations, injectAnnotations, unwrapInjectedAnnotationWrapper } from "./annotations.js";
|
|
2
2
|
import { inheritParentAnnotationsKey } from "./parser.js";
|
|
3
3
|
|
|
4
4
|
//#region src/annotation-state.ts
|
|
@@ -90,6 +90,17 @@ function getWrappedChildState(parentState, childState, parser) {
|
|
|
90
90
|
}
|
|
91
91
|
return withAnnotationView(childState, annotations);
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Reconciles object-owned child state with parent annotations using the same
|
|
95
|
+
* shared object-state inheritance rule across parser families.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
function reconcileObjectChildState(parentState, childState) {
|
|
100
|
+
const annotations = getAnnotations(parentState);
|
|
101
|
+
if (annotations === void 0 || childState == null || typeof childState !== "object" || getAnnotations(childState) === annotations) return childState;
|
|
102
|
+
return inheritAnnotations(parentState, childState);
|
|
103
|
+
}
|
|
93
104
|
|
|
94
105
|
//#endregion
|
|
95
|
-
export { annotationViewTargets, getWrappedChildParseState, getWrappedChildState, isAnnotationWrappedInitialState, normalizeInjectedAnnotationState, unwrapAnnotationView };
|
|
106
|
+
export { annotationViewTargets, getWrappedChildParseState, getWrappedChildState, isAnnotationWrappedInitialState, normalizeInjectedAnnotationState, reconcileObjectChildState, unwrapAnnotationView };
|
package/dist/constructs.cjs
CHANGED
|
@@ -305,9 +305,7 @@ function getAnnotatedFieldState(parentState, field, parser) {
|
|
|
305
305
|
return require_annotation_state.getWrappedChildState(parentState, sourceState, parser);
|
|
306
306
|
}
|
|
307
307
|
function getObjectParseChildState(parentState, childState, _parser) {
|
|
308
|
-
|
|
309
|
-
if (annotations === void 0 || childState == null || typeof childState !== "object" || require_annotations.getAnnotations(childState) === annotations) return childState;
|
|
310
|
-
return require_annotations.inheritAnnotations(parentState, childState);
|
|
308
|
+
return require_annotation_state.reconcileObjectChildState(parentState, childState);
|
|
311
309
|
}
|
|
312
310
|
function buildSuggestRuntimeNodesFromPairs(pairs, state, parentPath) {
|
|
313
311
|
const prefix = parentPath ?? [];
|
package/dist/constructs.js
CHANGED
|
@@ -10,7 +10,7 @@ import { completeOrExtractPhase2Seed, extractPhase2Seed, extractPhase2SeedKey, p
|
|
|
10
10
|
import { DEFAULT_FIND_SIMILAR_OPTIONS, createErrorWithSuggestions, createSuggestionMessage, deduplicateSuggestions, findSimilar } from "./suggestion.js";
|
|
11
11
|
import { collectLeadingCandidates } from "./usage-internals.js";
|
|
12
12
|
import { defineInheritedAnnotationParser, getParserSuggestRuntimeNodes, unmatchedNonCliDependencySourceStateMarker } from "./parser.js";
|
|
13
|
-
import { annotationViewTargets, getWrappedChildParseState, getWrappedChildState, unwrapAnnotationView } from "./annotation-state.js";
|
|
13
|
+
import { annotationViewTargets, getWrappedChildParseState, getWrappedChildState, reconcileObjectChildState, unwrapAnnotationView } from "./annotation-state.js";
|
|
14
14
|
|
|
15
15
|
//#region src/constructs.ts
|
|
16
16
|
/**
|
|
@@ -305,9 +305,7 @@ function getAnnotatedFieldState(parentState, field, parser) {
|
|
|
305
305
|
return getWrappedChildState(parentState, sourceState, parser);
|
|
306
306
|
}
|
|
307
307
|
function getObjectParseChildState(parentState, childState, _parser) {
|
|
308
|
-
|
|
309
|
-
if (annotations === void 0 || childState == null || typeof childState !== "object" || getAnnotations(childState) === annotations) return childState;
|
|
310
|
-
return inheritAnnotations(parentState, childState);
|
|
308
|
+
return reconcileObjectChildState(parentState, childState);
|
|
311
309
|
}
|
|
312
310
|
function buildSuggestRuntimeNodesFromPairs(pairs, state, parentPath) {
|
|
313
311
|
const prefix = parentPath ?? [];
|