mirror of
https://github.com/tauri-apps/tauri-toml.git
synced 2026-02-04 18:31:17 +01:00
11 lines
197 B
JavaScript
11 lines
197 B
JavaScript
'use strict'
|
|
module.exports = value => {
|
|
const date = new Date(value)
|
|
/* istanbul ignore if */
|
|
if (isNaN(date)) {
|
|
throw new TypeError('Invalid Datetime')
|
|
} else {
|
|
return date
|
|
}
|
|
}
|