@noego/trust 0.5.0-dev.4 → 0.5.0-dev.5

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.
@@ -2051,6 +2051,12 @@ var MISUSED_PROMISE_MESSAGES = {
2051
2051
  var RESULT_CONDITION_RULE = "result-condition";
2052
2052
  var RESULT_CONDITION_ORIGIN = "condition";
2053
2053
  var RESULT_CONDITION_MESSAGE = "Result used as a condition is always truthy (Ok and Err are both objects); test `.ok` instead: `if (result.ok)` / `if (!result.ok)`.";
2054
+ var RESULT_LOOKALIKE_RULE = "result-lookalike";
2055
+ var RESULT_LOOKALIKE_ORIGIN = "declaration";
2056
+ var RESULT_LOOKALIKE_MESSAGE = 'Type "{{name}}" is a hand-written Result: it is told apart by `ok: true` / `ok: false` but is not @noego/trust\'s Result, so no rule follows its failure and nothing tells it from a real Result or an `{ ok, result }` envelope. Return Result<T, E> from @noego/trust inside the program; at an edge, decide the Result and return plain data with its own discriminant (`status`, `kind`).';
2057
+ function resultLookalikeMessage(name) {
2058
+ return fillMessage(RESULT_LOOKALIKE_MESSAGE, { name });
2059
+ }
2054
2060
  var TYPE_CLAIM_RULE = "type-claim";
2055
2061
  var TYPE_CLAIM_MESSAGES = {
2056
2062
  "claim:as": 'Type assertion claims "{{from}}" is "{{to}}", but "{{from}}" is not assignable to "{{to}}": nothing proves it. Narrow or validate the value instead.',
@@ -6999,6 +7005,9 @@ export {
6999
7005
  RESULT_CONDITION_RULE,
7000
7006
  RESULT_CONDITION_ORIGIN,
7001
7007
  RESULT_CONDITION_MESSAGE,
7008
+ RESULT_LOOKALIKE_RULE,
7009
+ RESULT_LOOKALIKE_ORIGIN,
7010
+ resultLookalikeMessage,
7002
7011
  TYPE_CLAIM_RULE,
7003
7012
  TYPE_CLAIM_MESSAGES,
7004
7013
  ACCEPT_DIRECTIVE_MESSAGES,
@@ -7063,4 +7072,4 @@ export {
7063
7072
  readBaseline,
7064
7073
  describeBaselineDelta
7065
7074
  };
7066
- //# sourceMappingURL=chunk-6YBPW4NP.js.map
7075
+ //# sourceMappingURL=chunk-GJUWPZZJ.js.map