feat(id): 具名化 JS 导出并动态包裹错误(by AI)
This commit is contained in:
parent
5590037abe
commit
08d2a9f2a3
@ -1,5 +1,10 @@
|
||||
# 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。
|
||||
|
||||
|
||||
8
go.mod
8
go.mod
@ -3,9 +3,9 @@ module apigo.cc/go/id
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
apigo.cc/go/encoding v1.5.3
|
||||
apigo.cc/go/jsmod v1.5.2
|
||||
apigo.cc/go/rand v1.5.2
|
||||
apigo.cc/go/encoding v1.5.4
|
||||
apigo.cc/go/jsmod v1.5.3
|
||||
apigo.cc/go/rand v1.5.3
|
||||
)
|
||||
|
||||
require apigo.cc/go/cast v1.5.2
|
||||
require apigo.cc/go/cast v1.5.3
|
||||
|
||||
@ -8,7 +8,11 @@ import (
|
||||
|
||||
func init() {
|
||||
jsmod.Register("id", map[string]any{
|
||||
"Make": func(size int, forDB *string) string {
|
||||
"Make": jsMake,
|
||||
})
|
||||
}
|
||||
|
||||
func jsMake(size int, forDB *string) string {
|
||||
dbType := ""
|
||||
if forDB != nil {
|
||||
dbType = strings.ToLower(*forDB)
|
||||
@ -22,6 +26,4 @@ func init() {
|
||||
default:
|
||||
return DefaultIDMaker.Get(size)
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user