mirror of
https://github.com/lune-org/lune.git
synced 2025-04-11 22:10:53 +01:00
feat(types): include and document json5 support in types
This commit is contained in:
parent
532409aa25
commit
e4c4ea4129
1 changed files with 8 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
export type EncodeDecodeFormat = "json" | "yaml" | "toml"
|
||||
export type EncodeDecodeFormat = "json" | "json5" | "yaml" | "toml"
|
||||
|
||||
export type CompressDecompressFormat = "brotli" | "gzip" | "lz4" | "zlib"
|
||||
|
||||
|
@ -18,6 +18,7 @@ export type CompressDecompressFormat = "brotli" | "gzip" | "lz4" | "zlib"
|
|||
|
||||
-- Parse different file formats into lua tables
|
||||
local someJson = serde.decode("json", fs.readFile("myFile.json"))
|
||||
local someJson5 = serde.decode("json5", fs.readFile("myFile.json5"))
|
||||
local someToml = serde.decode("toml", fs.readFile("myFile.toml"))
|
||||
local someYaml = serde.decode("yaml", fs.readFile("myFile.yaml"))
|
||||
|
||||
|
@ -61,8 +62,9 @@ end
|
|||
Currently supported formats:
|
||||
|
||||
| Name | Learn More |
|
||||
|:-------|:---------------------|
|
||||
|:--------|:---------------------|
|
||||
| `json` | https://www.json.org |
|
||||
| `json5` | https://json5.org |
|
||||
| `yaml` | https://yaml.org |
|
||||
| `toml` | https://toml.io |
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue