UNPKG

@flourd/toml

Version:

Familiar parse and stringify for TOML, with a CLI to convert to/from JSON.

18 lines (17 loc) 433 B
class TomlError extends Error { constructor (msg) { super(msg) this.name = 'TomlError' /* istanbul ignore next */ if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError) this.fromTOML = true this.wrapped = null } } TomlError.wrap = err => { const terr = new TomlError(err.message) terr.code = err.code terr.wrapped = err return terr } module.exports = exports.TomlError = TomlError;