Compare commits

..

No commits in common. "08d2a9f2a31d27ddcf0e37d12da938bb7a4afb19" and "14205a949db102822828c2199df3bd1aaabbc3e1" have entirely different histories.

3 changed files with 19 additions and 32 deletions

View File

@ -1,16 +1,5 @@
# Changelog: @go/id
## v1.5.4 (2026-06-21)
- **重构与错误堆栈支持**:
- 重构 `js_export.go`,将 `Make` 匿名包装闭包改为包级具名函数 `jsMake`
- 升级 `encoding` 依赖至 v1.5.4`jsmod` 依赖至 v1.5.3`rand` 依赖至 v1.5.3`cast` 依赖至 v1.5.3。
## v1.5.3 (2026-06-11)
- **版本对齐**: 基础设施全局对齐 v1.5.3。
## v1.5.2 (2026-06-09)
- **版本对齐**: 基础设施全局对齐 v1.5.2。
## v1.5.1 (2026-06-08)
- **JS 极简 API**: 彻底废除 JS 侧冗长难记的 `get8Bytes...` 等方法,统一收敛为极简的 `Make(size int, forDB ...string)`。充分利用了底层 JS Bridge 的零值回退特性,在不填第二个参数时也能安全优雅地工作。

8
go.mod
View File

@ -3,9 +3,9 @@ module apigo.cc/go/id
go 1.25.0
require (
apigo.cc/go/encoding v1.5.4
apigo.cc/go/jsmod v1.5.3
apigo.cc/go/rand v1.5.3
apigo.cc/go/encoding v1.5.0
apigo.cc/go/jsmod v1.5.0
apigo.cc/go/rand v1.5.0
)
require apigo.cc/go/cast v1.5.3
require apigo.cc/go/cast v1.5.0 // indirect

View File

@ -8,11 +8,7 @@ import (
func init() {
jsmod.Register("id", map[string]any{
"Make": jsMake,
})
}
func jsMake(size int, forDB *string) string {
"Make": func(size int, forDB *string) string {
dbType := ""
if forDB != nil {
dbType = strings.ToLower(*forDB)
@ -26,4 +22,6 @@ func jsMake(size int, forDB *string) string {
default:
return DefaultIDMaker.Get(size)
}
},
})
}