graph-validators: speed up validators by adding type casts

This commit is contained in:
Logan Allen 2021-03-30 12:20:32 -05:00 committed by Matilde Park
parent 9cff3ba724
commit 3c8ac1edb1
3 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/- *post, met=metadata-store
/- *post, met=metadata-store, graph=graph-store, hark=hark-graph-hook
|_ i=indexed-post
++ grow
|%
@ -6,17 +6,20 @@
::
++ graph-permissions-add
|= vip=vip-metadata:met
^- permissions:graph
?+ index.p.i !!
[@ ~] [%yes %yes %no]
==
::
++ graph-permissions-remove
|= vip=vip-metadata:met
^- permissions:graph
?+ index.p.i !!
[@ ~] [%self %self %no]
==
::
++ notification-kind
^- (unit notif-kind:hark)
?+ index.p.i ~
[@ ~] `[%message [0 1] %count %none]
==

View File

@ -1,4 +1,4 @@
/- *post, met=metadata-store
/- *post, met=metadata-store, graph=graph-store, hark=hark-graph-hook
|_ i=indexed-post
++ grow
|%
@ -6,6 +6,7 @@
::
++ graph-permissions-add
|= vip=vip-metadata:met
^- permissions:graph
=/ reader
?=(%reader-comments vip)
?+ index.p.i !!
@ -16,6 +17,7 @@
::
++ graph-permissions-remove
|= vip=vip-metadata:met
^- permissions:graph
=/ reader
?=(%reader-comments vip)
?+ index.p.i !!
@ -25,6 +27,7 @@
==
::
++ notification-kind
^- (unit notif-kind:hark)
?+ index.p.i ~
[@ ~] `[%link [0 1] %each %children]
[@ @ %1 ~] `[%comment [1 2] %count %siblings]

View File

@ -1,10 +1,11 @@
/- *post, met=metadata-store
/- *post, met=metadata-store, graph=graph-store, hark=hark-graph-hook
|_ i=indexed-post
++ grow
|%
++ noun i
++ graph-permissions-add
|= vip=vip-metadata:met
^- permissions:graph
?+ index.p.i !!
[@ ~] [%yes %yes %no] :: new note
[@ %1 @ ~] [%self %self %no]
@ -14,6 +15,7 @@
::
++ graph-permissions-remove
|= vip=vip-metadata:met
^- permissions:graph
?+ index.p.i !!
[@ ~] [%yes %self %self]
[@ %1 @ @ ~] [%yes %self %self]
@ -24,6 +26,7 @@
:: ignore all containers, only notify on content
::
++ notification-kind
^- (unit notif-kind:hark)
?+ index.p.i ~
[@ %1 %1 ~] `[%note [0 1] %each %children]
[@ %1 @ ~] `[%edit-note [0 1] %none %none]