@ferrule-io/ok-fine 0.3.11 → 0.3.13

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,3 +1,5 @@
1
+ /** Trust tiers, lowest to highest trust. */
2
+ export const TRUST_TIERS = ["proposed", "unverified", "machine-confirmed", "human-reviewed"];
1
3
  export const ISO_DATETIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
2
4
  export function normalizeVerified(v) {
3
5
  if (v == null) {
@@ -13,7 +15,15 @@ export function normalizeVerified(v) {
13
15
  }
14
16
  return result;
15
17
  }
18
+ /** A concept recording unmerged work: its `proposal` key is set to anything but null/false. */
19
+ export function isProposal(fm) {
20
+ const p = fm?.proposal;
21
+ return p !== undefined && p !== null && p !== false;
22
+ }
16
23
  export function trustTier(fm) {
24
+ if (isProposal(fm)) {
25
+ return "proposed";
26
+ }
17
27
  const verified = normalizeVerified(fm?.verified);
18
28
  if (verified.length === 0) {
19
29
  return "unverified";