@softchef/cdk-iot-device-management
Version:
IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.
21 lines (20 loc) • 558 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toDate = exports.iso8601 = void 0;
const iso8601 = (time) => exports.toDate(time)
.toISOString()
.replace(/\.\d{3}Z$/, "Z");
exports.iso8601 = iso8601;
const toDate = (time) => {
if (typeof time === "number") {
return new Date(time * 1000);
}
if (typeof time === "string") {
if (Number(time)) {
return new Date(Number(time) * 1000);
}
return new Date(time);
}
return time;
};
exports.toDate = toDate;