Files
NapCatQQ/.pnpm-store/v3/files/4c/655d7476814b63734164eb663f5cea49301dd2627ae284ce3c6c448620a572004dd59ee0fa9f7a0f622e7805c8966435366dd640cccb745fdd3d8a8b9e7d1c
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

45 lines
1.3 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Time = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
let Time = class Time {
constructor(time) {
if (time) {
if (typeof time === "string" || typeof time === "number" || time instanceof Date) {
const date = new Date(time);
if (date.getUTCFullYear() > 2049) {
this.generalTime = date;
}
else {
this.utcTime = date;
}
}
else {
Object.assign(this, time);
}
}
}
getTime() {
const time = this.utcTime || this.generalTime;
if (!time) {
throw new Error("Cannot get time from CHOICE object");
}
return time;
}
};
exports.Time = Time;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_schema_1.AsnPropTypes.UTCTime,
})
], Time.prototype, "utcTime", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({
type: asn1_schema_1.AsnPropTypes.GeneralizedTime,
})
], Time.prototype, "generalTime", void 0);
exports.Time = Time = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })
], Time);