@skmtc/core 0.54.0 → 0.55.0

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.
@@ -32,7 +32,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
32
32
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
33
33
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
34
34
  };
35
- var _EnrichmentAudit_instances, _EnrichmentAudit_consumed, _EnrichmentAudit_children, _EnrichmentAudit_warnings, _EnrichmentAudit_reported, _EnrichmentAudit_isConsumed, _EnrichmentAudit_divergenceSuggestion, _EnrichmentAudit_checkBlock;
35
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
36
+ if (kind === "m") throw new TypeError("Private method is not writable");
37
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
38
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
39
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
40
+ };
41
+ var _EnrichmentAudit_instances, _EnrichmentAudit_consumed, _EnrichmentAudit_children, _EnrichmentAudit_warnings, _EnrichmentAudit_reported, _EnrichmentAudit_records, _EnrichmentAudit_isConsumed, _EnrichmentAudit_divergenceSuggestion, _EnrichmentAudit_checkBlock;
36
42
  Object.defineProperty(exports, "__esModule", { value: true });
37
43
  exports.hasVariantEnrichment = exports.EnrichmentAudit = void 0;
38
44
  const Enrichments_js_1 = require("../types/Enrichments.js");
@@ -54,17 +60,41 @@ class EnrichmentAudit {
54
60
  );
55
61
  /** Identity keys of reported warnings — reads repeat, warnings must not. */
56
62
  _EnrichmentAudit_reported.set(this, new Set()
63
+ /** `false` inside {@link withoutRecording}. */
64
+ );
65
+ /** `false` inside {@link withoutRecording}. */
66
+ _EnrichmentAudit_records.set(this, true
57
67
  /**
58
- * Record one enrichment lookup. Every prefix of `segments` is marked
59
- * consumed, so block-level and leaf-level reads land in one namespace.
68
+ * Runs `fn` with nothing recorded: no lookup counts as a use, and no
69
+ * warning is kept. For a reader that is not the run, such as the file
70
+ * plan: it reads enrichments for projections the run may never insert,
71
+ * and those reads must not make configured paths look used.
60
72
  */
61
73
  );
62
74
  }
75
+ /**
76
+ * Runs `fn` with nothing recorded: no lookup counts as a use, and no
77
+ * warning is kept. For a reader that is not the run, such as the file
78
+ * plan: it reads enrichments for projections the run may never insert,
79
+ * and those reads must not make configured paths look used.
80
+ */
81
+ withoutRecording(fn) {
82
+ const records = __classPrivateFieldGet(this, _EnrichmentAudit_records, "f");
83
+ __classPrivateFieldSet(this, _EnrichmentAudit_records, false, "f");
84
+ try {
85
+ return fn();
86
+ }
87
+ finally {
88
+ __classPrivateFieldSet(this, _EnrichmentAudit_records, records, "f");
89
+ }
90
+ }
63
91
  /**
64
92
  * Record one enrichment lookup. Every prefix of `segments` is marked
65
93
  * consumed, so block-level and leaf-level reads land in one namespace.
66
94
  */
67
95
  consume(segments) {
96
+ if (!__classPrivateFieldGet(this, _EnrichmentAudit_records, "f"))
97
+ return;
68
98
  let parentKey = toPathKey([]);
69
99
  for (let end = 1; end <= segments.length; end++) {
70
100
  const key = toPathKey(segments.slice(0, end));
@@ -85,6 +115,8 @@ class EnrichmentAudit {
85
115
  * warning.
86
116
  */
87
117
  report(warning) {
118
+ if (!__classPrivateFieldGet(this, _EnrichmentAudit_records, "f"))
119
+ return;
88
120
  const key = toPathKey([warning.type, ...warning.path]);
89
121
  if (__classPrivateFieldGet(this, _EnrichmentAudit_reported, "f").has(key))
90
122
  return;
@@ -181,7 +213,7 @@ class EnrichmentAudit {
181
213
  }
182
214
  }
183
215
  exports.EnrichmentAudit = EnrichmentAudit;
184
- _EnrichmentAudit_consumed = new WeakMap(), _EnrichmentAudit_children = new WeakMap(), _EnrichmentAudit_warnings = new WeakMap(), _EnrichmentAudit_reported = new WeakMap(), _EnrichmentAudit_instances = new WeakSet(), _EnrichmentAudit_isConsumed = function _EnrichmentAudit_isConsumed(segments) {
216
+ _EnrichmentAudit_consumed = new WeakMap(), _EnrichmentAudit_children = new WeakMap(), _EnrichmentAudit_warnings = new WeakMap(), _EnrichmentAudit_reported = new WeakMap(), _EnrichmentAudit_records = new WeakMap(), _EnrichmentAudit_instances = new WeakSet(), _EnrichmentAudit_isConsumed = function _EnrichmentAudit_isConsumed(segments) {
185
217
  return __classPrivateFieldGet(this, _EnrichmentAudit_consumed, "f").has(toPathKey(segments));
186
218
  }, _EnrichmentAudit_divergenceSuggestion = function _EnrichmentAudit_divergenceSuggestion(path) {
187
219
  for (let depth = 0; depth < path.length; depth++) {