Skip to content

0.3.0

Compare
Choose a tag to compare
@LebJe LebJe released this 20 Feb 04:01
· 5 commits to main since this release

Changelog

Added

  • toml.decodeFromFile(filePath: string):
    • Decodes a TOML document at filePath. Throws the same errors as toml.decode.
  • toml.encodeToFile(data: table, fileOrOptions: string|table):
    • Encodes data to the file specified in fileOrOptions. the file will be created if it doesn't exist.
      • When fileOrOptions is a string, it simply is the file path.
      • When fileOrOptions is a table, it should havefile, and optionally, overwrite as keys. file is the file path, and overwrite should be true when file should be overwritten with data, and false when data should be appended to file.
  • Added tests that cover:
    • The property accessors of toml.Date, toml.Time, toml.DateTime, and toml.TimeOffset.
    • toml.toJSON and toml.toYAML.

Changed

  • toml.tomlToJSON and toml.tomlToYAML have been renamed to toml.toJSON and toml.toYAML.
    • They have been renamed because they now have two functions: converting a TOML string to JSON/YAML (as before), or converting a table into JSON/YAML.
    • The first parameter can be a string containing TOML (as before), or a table.