@noego/trust 0.5.1-dev.2 → 0.5.1-dev.3
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/README.md +155 -0
- package/dist/{baseline-D0Ok-NGU.d.ts → baseline-DMNO7IAl.d.ts} +20 -2
- package/dist/{chunk-V4FYZG5Q.js → chunk-2MSSO67W.js} +2 -2
- package/dist/{chunk-P4VFMA2A.js → chunk-3IIEQHH2.js} +382 -12
- package/dist/chunk-3IIEQHH2.js.map +1 -0
- package/dist/{chunk-RVTPDLEW.js → chunk-VJGGEY4G.js} +3481 -3456
- package/dist/chunk-VJGGEY4G.js.map +1 -0
- package/dist/cli/index.js +6 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/eslint/index.d.ts +5 -2
- package/dist/eslint/index.js +49 -12
- package/dist/eslint/index.js.map +1 -1
- package/dist/index.cjs +33 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -5
- package/dist/index.d.ts +66 -5
- package/dist/index.js +31 -5
- package/dist/index.js.map +1 -1
- package/dist/native/trust_native_wasm.wasm +0 -0
- package/package.json +4 -4
- package/dist/chunk-P4VFMA2A.js.map +0 -1
- package/dist/chunk-RVTPDLEW.js.map +0 -1
- /package/dist/{chunk-V4FYZG5Q.js.map → chunk-2MSSO67W.js.map} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
untrustedValueContext,
|
|
25
25
|
untrustedValueMessage,
|
|
26
26
|
untrustedValuesIn
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-3IIEQHH2.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-
|
|
37
|
+
} from "../chunk-2MSSO67W.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-
|
|
65
|
+
} from "../chunk-VJGGEY4G.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 =
|
|
182
|
+
var NATIVE_PROTOCOL_VERSION = 5;
|
|
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"), 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}`);
|