mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
18 lines
350 B
TypeScript
18 lines
350 B
TypeScript
// Loaded from https://unpkg.com/luxon@1.25.0/src/impl/invalid.js
|
|
|
|
|
|
export default class Invalid {
|
|
constructor(reason, explanation) {
|
|
this.reason = reason;
|
|
this.explanation = explanation;
|
|
}
|
|
|
|
toMessage() {
|
|
if (this.explanation) {
|
|
return `${this.reason}: ${this.explanation}`;
|
|
} else {
|
|
return this.reason;
|
|
}
|
|
}
|
|
}
|