JSON

Library for parsing and saving arbitrary json data.


Source: pkg/lua/lib/json.go | Import: json

Functions


parse

parse(path) -> table<any>

Arguments

  • path string
Return Values

  • table<any> - Table representing the json file parsed.
parse_schema

parse_schema(path, schema) -> table<any>

Arguments

  • path string
  • schema table<any>
Return Values

  • table<any> - Table representing the json file parsed.
parse_string

parse_string(str) -> table<any>

Arguments

  • str string
Return Values

  • table<any> - Table representing the json string parsed.
parse_string_schema

parse_string_schema(str, schema) -> table<any>

Arguments

  • str string
  • schema table<any>
Return Values

  • table<any> - Table representing the json string parsed.
save

save(value, path, compact?)

Arguments

  • value table<any> - Table to convert to json.
  • path string
  • compact bool - Defaults to false, use to remove indent and new lines.
string

string(value, compact?) -> string

Arguments

  • value table<any> - Table to convert to json.
  • compact bool - Defaults to false, use to remove indent and new lines.
Return Values

  • string
standardize

standardize(str) -> string

Arguments

  • str string - JSON data as a string.
Return Values

  • string - The same JSON but with non-standard features removed.