feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
41
api.hyungi.net/node_modules/@peculiar/asn1-x509/build/es2015/time.js
generated
vendored
Normal file
41
api.hyungi.net/node_modules/@peculiar/asn1-x509/build/es2015/time.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { __decorate } from "tslib";
|
||||
import { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from "@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;
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
AsnProp({
|
||||
type: AsnPropTypes.UTCTime,
|
||||
})
|
||||
], Time.prototype, "utcTime", void 0);
|
||||
__decorate([
|
||||
AsnProp({
|
||||
type: AsnPropTypes.GeneralizedTime,
|
||||
})
|
||||
], Time.prototype, "generalTime", void 0);
|
||||
Time = __decorate([
|
||||
AsnType({ type: AsnTypeTypes.Choice })
|
||||
], Time);
|
||||
export { Time };
|
||||
Reference in New Issue
Block a user