Skip to content

fix: improve type safety with function overloads#112

Open
jin-sir wants to merge 2 commits into
DTStack:masterfrom
jin-sir:fix_formatDateTime
Open

fix: improve type safety with function overloads#112
jin-sir wants to merge 2 commits into
DTStack:masterfrom
jin-sir:fix_formatDateTime

Conversation

@jin-sir

@jin-sir jin-sir commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

变更内容

  • 添加函数重载,提升类型推断能力
  • 使用预定义 DateTimeFormat 枚举时返回 string 类型
  • 使用自定义格式字符串时返回 dayjs.Dayjs 类型
  • 移除未使用的 FormatPattern 类型定义

变更原因

  • 提升 TypeScript 类型安全性和开发体验

@jin-sir jin-sir force-pushed the fix_formatDateTime branch from c1d85fe to 8a78e47 Compare June 17, 2026 13:30
@jin-sir jin-sir requested a review from liuxy0551 June 17, 2026 13:39
Comment thread src/formatDateTime/index.ts Outdated
Comment thread src/formatDateTime/index.ts Outdated
Comment thread src/formatDateTime/index.ts
Comment thread src/formatDateTime/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants