devsite/node_modules/@iarna/toml/lib/create-datetime.js
2024-07-07 18:49:38 -07:00

11 lines
197 B
JavaScript
Executable File

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