@noego/trust 0.5.1-dev.2 → 0.5.1-dev.4

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.
@@ -7,7 +7,7 @@ import {
7
7
  sourceFileOf,
8
8
  svelteFor,
9
9
  toPosix
10
- } from "./chunk-RVTPDLEW.js";
10
+ } from "./chunk-4XGOH7JE.js";
11
11
 
12
12
  // src/cli/source-files.ts
13
13
  import { existsSync, readdirSync, statSync } from "fs";
@@ -109,4 +109,4 @@ export {
109
109
  compareFindings,
110
110
  formatFinding
111
111
  };
112
- //# sourceMappingURL=chunk-V4FYZG5Q.js.map
112
+ //# sourceMappingURL=chunk-6K5I3ZRI.js.map
package/dist/cli/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  untrustedValueContext,
25
25
  untrustedValueMessage,
26
26
  untrustedValuesIn
27
- } from "../chunk-P4VFMA2A.js";
27
+ } from "../chunk-35ETSKEC.js";
28
28
  import {
29
29
  compareFindings,
30
30
  forEachSourceFile,
@@ -34,7 +34,7 @@ import {
34
34
  logWalkFailure,
35
35
  relativeTo,
36
36
  resolveFiles
37
- } from "../chunk-V4FYZG5Q.js";
37
+ } from "../chunk-6K5I3ZRI.js";
38
38
  import {
39
39
  BOUNDARY_RULE,
40
40
  DROPPED_RESULT_RULE,
@@ -62,7 +62,7 @@ import {
62
62
  svelteFor,
63
63
  svelteForSource,
64
64
  updateBaseline
65
- } from "../chunk-RVTPDLEW.js";
65
+ } from "../chunk-4XGOH7JE.js";
66
66
 
67
67
  // src/cli/baseline-command.ts
68
68
  import { existsSync, writeFileSync } from "fs";
@@ -179,7 +179,7 @@ function nativeEngine(options = {}) {
179
179
  }
180
180
 
181
181
  // src/cli/native-check.ts
182
- var NATIVE_PROTOCOL_VERSION = 4;
182
+ var NATIVE_PROTOCOL_VERSION = 6;
183
183
  var WASM_STACK_SIZE_MB = 256;
184
184
  var OPT_IN_RULES = [];
185
185
  function runBinary(binary, request, cwd) {
@@ -263,7 +263,7 @@ async function checkNative(options) {
263
263
  extraRoots,
264
264
  programs: options.programs,
265
265
  perf: options.perf ?? false,
266
- rules: { typeClaim: isRuleEnabled(config, "type-claim"), untrustedValue: isRuleEnabled(config, "untrusted-value"), untrustedCallbacks: config.rules.untrustedCallbacks, droppedResult: isRuleEnabled(config, "dropped-result"), redundantGuard: isRuleEnabled(config, "redundant-guard"), resultLookalike: config.rules["result-lookalike"] },
266
+ rules: { trustedState: isRuleEnabled(config, "trusted-state"), typeClaim: isRuleEnabled(config, "type-claim"), untrustedValue: isRuleEnabled(config, "untrusted-value"), untrustedCallbacks: config.rules.untrustedCallbacks, droppedResult: isRuleEnabled(config, "dropped-result"), redundantGuard: isRuleEnabled(config, "redundant-guard"), finallyReturn: isRuleEnabled(config, "finally-return"), resultLookalike: config.rules["result-lookalike"] },
267
267
  config: {
268
268
  levels: config.levels.map((level) => ({ source: level.source, trust: level.trust, distrust: level.distrust, typeTrust: level.typeTrust, typeDistrust: level.typeDistrust })),
269
269
  passthrough: config.passthrough.map((group) => ({ source: group.source, baseDir: group.baseDir, patterns: group.patterns })),
@@ -647,7 +647,7 @@ function explain(options) {
647
647
  function describeBoundary(boundary) {
648
648
  const lines = [` boundary: ${boundary.member} (${boundary.item}, rule ${BOUNDARY_RULE})`];
649
649
  const { verdict } = boundary;
650
- const returns = verdict.kind === "plain" ? "plain data: nothing reported" : verdict.kind === "result" ? `a Result that can fail with ${formatFailureKinds(verdict.kinds, ANY_KIND)}` : `\`${verdict.type}\`, which may hold a Result`;
650
+ const returns = verdict.kind === "plain" ? "plain data: nothing reported" : verdict.kind === "result" ? verdict.kinds.length === 0 ? "a Result object that cannot fail" : `a Result that can fail with ${formatFailureKinds(verdict.kinds, ANY_KIND)}` : `\`${verdict.type}\`, which may hold a Result`;
651
651
  if (boundary.excludedBy) lines.push(` returns: ${returns}`, ` excluded: by "${boundary.excludedBy}" in the item's "exclude": nothing reported`);
652
652
  else if (boundary.reported) lines.push(` returns: ${returns}: reported as ${boundary.reported === "warning" ? "a warning (an error where strict applies)" : "an error"}`);
653
653
  else lines.push(` returns: ${returns}`);