def key
import ezx@1.11.0.0/src/fetch/world.bend as Worldimport Base
import ezx@1.11.0.0/src/lock/up.bend as Up
107# a question as a key. A lock's value never holds a newline, so the fields
108# are kept apart by one.
109def key(ask: Ask) -> String:
110 match ask:
111 case Laid{hash}:
112 "laid\n" ++ hash
113 case Git{hash, q}:
114 "git\n" ++ hash ++ "\n" ++ Up.key(q)
115 case Hub{q}:
116 hub.key(q)
117 case Named{nv}:
118 "named\n" ++ nv
119 case Tree{hash, _entry}:
120 "tree\n" ++ hash