Skip to main content

Aliasy

  • json.getpath

Argumenty

table
wymagane
Root table, z ktorej odbywa sie odczyt. Function wymaga, aby ten argument byl table.
string | table
wymagane
Path do przejscia. string jest split po dots; integer string tokens sa czytane przez raw array indexing. table path uzywa swoich array entries od 1 do #path jako keys.
any
Fallback value zwracany, gdy traversal trafi na nil albo non-table przed koncem path.

Zwroty

any | nil
Value pod requested path. Jesli path jest missing, zwraca defaultValue gdy podane, w przeciwnym razie nil.

Przykład

Czytaj nested table value z dotted string path albo array table of keys.