update: getOr

This commit is contained in:
Lucas F. 2026-01-12 15:04:37 -03:00
parent 9bde4370a6
commit 024386eaf5

View file

@ -105,6 +105,9 @@ pub const Context = struct {
return current;
}
pub fn getOr(self: *Context, path: []const u8, default: anytype) ?Value {
return self.get(path) orelse try self.toValue(default);
}
// pub fn get(self: *const Context, comptime T: type, key: []const u8) !T {
// // const opt_value = self.map.get(key) orelse return error.KeyNotFound;