Open 1amageek opened 3 days ago
Including the copy()
method in AnyCalendarDate
interface caused data handling issues:
When normalizing dates, CalendarDate
constructor was being called recursively due to the object spread operator, making the process unnecessarily complex and prone to side effects.
Separated concerns by:
copy()
method to a new Copyable
interfaceAnyCalendarDate
as a pure data structure interfaceNew interface structure:
export interface AnyCalendarDate {
readonly calendar: Calendar,
readonly era: string,
readonly year: number,
readonly month: number,
readonly day: number
}
export interface AnyTime { readonly hour: number, readonly minute: number, readonly second: number, readonly millisecond: number }
export interface Copyable { copy(): this }
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
Verify constructor normalizes dates correctly: