def key

bendvy-ecs-core@0.1.0.4 · restore_raw.bend:41

import bendvy-ecs-core@0.1.0.4/restore_raw.bend as RestoreRaw
import Base
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/entity_key.bend as Key

41def key(+path:String,raw:D.Raw) -> Decoded<Key.Key>:
42  match raw:
43    case D.Object{+fields}:key_index(path,fields,number(path ++ ".index",D.field("index",fields),False{}))
44    case other:invalid(~Key.Key,path,"object",other)

Uses (10)

Used by (3)