Open koraa opened 3 years ago
Rename the Get trait to TryGet; the signature should be tryGet(key, default). We can derive from this:
tryGet(key, default)
const get = (c, k) => { const none = Symbol(); const r = tryGet(c, k, none); assert(r !== none, "No such element"); return r; }; const has = (c, k) => { const none = Symbol(); return tryGet(c, k, none) !== none; }
Edit: This is a breaking change.
Rename the Get trait to TryGet; the signature should be
tryGet(key, default)
. We can derive from this:Edit: This is a breaking change.