diff --git a/vlib/toml/toml.v b/vlib/toml/toml.v index 3c6a66f5d9..32c0b66ed0 100644 --- a/vlib/toml/toml.v +++ b/vlib/toml/toml.v @@ -89,6 +89,12 @@ pub fn (d Doc) to_json() string { return d.ast.to_json() } +// to_any converts the `Doc` to toml.Any type. +pub fn (d Doc) to_any() Any { + values := d.ast.table as map[string]ast.Value + return d.ast_to_any(values) +} + // value queries a value from the TOML document. // `key` should be in "dotted" form (`a.b.c`). // `key` supports quoted keys like `a."b.c"`.