@telorun/analyzer 0.34.0 → 0.34.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-base-mapping.d.ts","sourceRoot":"","sources":["../src/validate-base-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-base-mapping.d.ts","sourceRoot":"","sources":["../src/validate-base-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAmBzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,aAAa,GACrB,kBAAkB,EAAE,CAwCtB"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { isCompiledValue } from "@telorun/sdk";
|
|
2
|
+
import { isTaggedSentinel } from "@telorun/templating";
|
|
2
3
|
import { effectiveAuthorSchema, resolveParent } from "./extends-resolution.js";
|
|
3
4
|
import { DiagnosticSeverity } from "./types.js";
|
|
4
5
|
const SOURCE = "telo-analyzer";
|
|
5
|
-
/** True when a value subtree contains a
|
|
6
|
-
*
|
|
6
|
+
/** True when a value subtree contains a CEL leaf — either a compiled CEL value
|
|
7
|
+
* (post-precompile) or the raw `!cel` tagged sentinel the analyzer sees at
|
|
8
|
+
* `telo check` time (this validator runs on the un-precompiled tree). Such a
|
|
9
|
+
* value can produce anything at runtime, so its type is not statically
|
|
10
|
+
* checkable. */
|
|
7
11
|
function containsCel(value) {
|
|
8
12
|
if (isCompiledValue(value))
|
|
9
13
|
return true;
|
|
14
|
+
if (isTaggedSentinel(value) && value.engine === "cel")
|
|
15
|
+
return true;
|
|
10
16
|
if (Array.isArray(value))
|
|
11
17
|
return value.some(containsCel);
|
|
12
18
|
if (value && typeof value === "object") {
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ResourceDefinition, ResourceManifest } from "@telorun/sdk";
|
|
2
2
|
import { isCompiledValue } from "@telorun/sdk";
|
|
3
|
+
import { isTaggedSentinel } from "@telorun/templating";
|
|
3
4
|
import type { AliasResolver } from "./alias-resolver.js";
|
|
4
5
|
import type { DefinitionRegistry } from "./definition-registry.js";
|
|
5
6
|
import { effectiveAuthorSchema, resolveParent, type DefResolver } from "./extends-resolution.js";
|
|
@@ -7,10 +8,14 @@ import { DiagnosticSeverity, type AnalysisDiagnostic } from "./types.js";
|
|
|
7
8
|
|
|
8
9
|
const SOURCE = "telo-analyzer";
|
|
9
10
|
|
|
10
|
-
/** True when a value subtree contains a
|
|
11
|
-
*
|
|
11
|
+
/** True when a value subtree contains a CEL leaf — either a compiled CEL value
|
|
12
|
+
* (post-precompile) or the raw `!cel` tagged sentinel the analyzer sees at
|
|
13
|
+
* `telo check` time (this validator runs on the un-precompiled tree). Such a
|
|
14
|
+
* value can produce anything at runtime, so its type is not statically
|
|
15
|
+
* checkable. */
|
|
12
16
|
function containsCel(value: unknown): boolean {
|
|
13
17
|
if (isCompiledValue(value)) return true;
|
|
18
|
+
if (isTaggedSentinel(value) && value.engine === "cel") return true;
|
|
14
19
|
if (Array.isArray(value)) return value.some(containsCel);
|
|
15
20
|
if (value && typeof value === "object") {
|
|
16
21
|
return Object.values(value as Record<string, unknown>).some(containsCel);
|