Fix StartOS 0.4 TypeScript packaging to match SDK API

This commit is contained in:
MacPro
2026-04-09 15:10:44 -05:00
parent 68ec875ee7
commit 8298c083c7
3436 changed files with 867051 additions and 92 deletions
Generated Vendored Executable
+22
View File
@@ -0,0 +1,22 @@
'use strict'
const f = require('./format-num.js')
class Time extends Date {
constructor (value) {
super(`0000-01-01T${value}Z`)
this.isTime = true
}
toISOString () {
return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`
}
}
module.exports = value => {
const date = new Time(value)
/* istanbul ignore if */
if (isNaN(date)) {
throw new TypeError('Invalid Datetime')
} else {
return date
}
}