diff options
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 1ed59ffdc8ed..c0dce868c6fc 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -271,6 +271,11 @@ fn pure_builtins() -> Vec<Builtin> { Ok(res) }, ), + Builtin::new("fromJSON", &[true], |args: Vec<Value>, _: &mut VM| { + let json_str = args[0].to_str()?; + let json: serde_json::Value = serde_json::from_str(&json_str)?; + json.try_into() + }), Builtin::new("genList", &[true, true], |args: Vec<Value>, vm: &mut VM| { let len = args[1].as_int()?; (0..len) |