别名
json.getpath
参数
table
必填
要读取的 root table。function 要求这个 argument 是 table。
string | table
必填
要跟随的 path。string 会按 dots split;integer string tokens 使用 raw array indexing 读取。table path 使用从 1 到 #path 的 array entries 作为 keys。
any
当 traversal 在 path 完成前到达 nil 或 non-table 时返回的 fallback value。
返回值
any | nil
Requested path 处的 value。如果 path missing,提供了 defaultValue 就返回它,否则返回 nil。