diff options
Diffstat (limited to 'backupdesk/lib/json/common.hoon')
-rw-r--r-- | backupdesk/lib/json/common.hoon | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/backupdesk/lib/json/common.hoon b/backupdesk/lib/json/common.hoon new file mode 100644 index 0000000..64d4b03 --- /dev/null +++ b/backupdesk/lib/json/common.hoon @@ -0,0 +1,29 @@ +/+ sr=sortug +|% +++ en +=, enjs:format + |% + ++ cord |= s=@t ^- json s+s + ++ hex |= h=@ux ^- json + [%s (crip (scow:sr %ux h))] + ++ b64 |= h=@uv ^- json + [%s (crip (scow:sr %uv h))] + ++ ud |= n=@ ^- json + [%s (crip (scow:sr %ud n))] + ++ patp |= p=@p ^- json + [%s (scot %p p)] + -- +++ de +=, dejs-soft:format + |% + ++ hex |= jon=json ^- (unit @ux) + ?. ?=(%s -.jon) ~ + =/ atom=(unit @) (slaw:sr %ux p.jon) + ?~ atom ~ + atom + ++ se |= aur=@tas |= jon=json + ?. ?=(%s -.jon) ~ + (slaw aur p.jon) + -- + +-- |