Compare commits

..

No commits in common. "main" and "v1.3.4" have entirely different histories.
main ... v1.3.4

4 changed files with 15 additions and 16 deletions

View File

@ -1,8 +1,5 @@
# CHANGELOG
## v1.5.1 (2026-06-08)
- **JS 对齐**: 将所有注册到 `jsmod` 的导出方法名统一为 PascalCase`ToJSON`, `FromJSON`, `Now`),以消除 JS 与 Go 调用体感上的摩擦。
## [v1.2.9] - 2026-05-09
### Changed
- **移除第三方依赖**: 移除了对 `jsontag` 模块的依赖,统一使用标准库及自有基础设施对齐,增强了模块的独立性与长期稳定性。

2
go.mod
View File

@ -2,4 +2,4 @@ module apigo.cc/go/cast
go 1.25.0
require apigo.cc/go/jsmod v1.5.0
require apigo.cc/go/jsmod v1.0.0

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
apigo.cc/go/jsmod v1.0.0 h1:lVQMq0tCno4kbHlQ3j5wzsm+v24J+bznIoHxpton0pE=
apigo.cc/go/jsmod v1.0.0/go.mod h1:bmyeZtOAP/j5am+YRnaiM89smysK24K7ebk0koFtsSw=

View File

@ -7,25 +7,25 @@ import (
func init() {
jsmod.Register("cast", map[string]any{
// JSON
"ToJSON": ToJSON,
"PrettyToJSON": PrettyToJSON,
"FromJSON": func(data any) (any, error) {
"toJSON": ToJSON,
"prettyJSON": PrettyToJSON,
"fromJSON": func(data any) (any, error) {
var res any
err := UnmarshalJSON(data, &res)
return res, err
},
// Time
"Now": Now,
"ParseTime": ParseTime,
"FormatTime": FormatTime,
"AddTime": AddTime,
"Duration": Duration,
"DescribeDuration": DescribeDuration,
"now": Now,
"parseTime": ParseTime,
"formatTime": FormatTime,
"addTime": AddTime,
"duration": Duration,
"describeDuration": DescribeDuration,
// Logic
"Split": Split,
"SplitArgs": SplitArgs,
"JoinArgs": JoinArgs,
"split": Split,
"splitArgs": SplitArgs,
"joinArgs": JoinArgs,
})
}