UNPKG

@iarna/toml

Version:

Better TOML parsing and stringifying all in that familiar JSON interface.

11 lines (10 loc) 197 B
'use strict' module.exports = value => { const date = new Date(value) /* istanbul ignore if */ if (isNaN(date)) { throw new TypeError('Invalid Datetime') } else { return date } }