Compare commits

..

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

2 changed files with 6 additions and 23 deletions

View File

@ -1,8 +1,5 @@
# Changelog: @go/id # Changelog: @go/id
## v1.5.1 (2026-06-08)
- **JS 极简 API**: 彻底废除 JS 侧冗长难记的 `get8Bytes...` 等方法,统一收敛为极简的 `Make(size int, forDB ...string)`。充分利用了底层 JS Bridge 的零值回退特性,在不填第二个参数时也能安全优雅地工作。
## [v1.3.2] - 2026-05-30 ## [v1.3.2] - 2026-05-30
### Added ### Added

View File

@ -1,27 +1,13 @@
package id package id
import ( import "apigo.cc/go/jsmod"
"strings"
"apigo.cc/go/jsmod"
)
func init() { func init() {
jsmod.Register("id", map[string]any{ jsmod.Register("id", map[string]any{
"Make": func(size int, forDB *string) string { "get8Bytes4KPerSecond": Get8Bytes4KPerSecond,
dbType := "" "get9Bytes90KPerSecond": Get9Bytes90KPerSecond,
if forDB != nil { "get10Bytes14MPerSecond": Get10Bytes14MPerSecond,
dbType = strings.ToLower(*forDB) "get11Bytes900MPerSecond": Get11Bytes900MPerSecond,
} "get12BytesUltraPerSecond": Get12BytesUltraPerSecond,
switch dbType {
case "mysql":
return DefaultIDMaker.GetForMysql(size)
case "postgres", "pg", "pgsql":
return DefaultIDMaker.GetForPostgreSQL(size)
default:
return DefaultIDMaker.Get(size)
}
},
}) })
} }