Capy-Bearer Documentation

Get a child by path

lib call

Capy

function get_by_path(value : dval, path : string) dval

Description

get_by_path(value, path) reads a nested child without creating nodes. Use a slash between path segments.

Parameters

value : source value

path : slash-separated child path

Return Values

The copied child, or an empty string value when the path fails.

Example

Capy

var config := dval({"site": {"title": "Bearer"}})
print(get_by_path(config, "site/title"), "\n")