feat: align JS exports to PascalCase (by AI)
This commit is contained in:
parent
81cac28e12
commit
ebd14f7c62
@ -1,5 +1,8 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## [Unreleased]
|
## v1.5.1 (2026-06-08)
|
||||||
|
- **JS 对齐**: 将所有注册到 `jsmod` 的导出方法名统一为 PascalCase(如 `Int`, `FastInt`, `Byte`),以消除 JS 与 Go 调用体感上的摩擦。
|
||||||
|
|
||||||
|
## v1.5.0 (2026-05-10)
|
||||||
- 优化 `Bytes` 函数,提升随机生成健壮性。
|
- 优化 `Bytes` 函数,提升随机生成健壮性。
|
||||||
- 完善 `TEST.md` 性能基准报告与功能测试覆盖。
|
- 完善 `TEST.md` 性能基准报告与功能测试覆盖。
|
||||||
|
|||||||
14
js_export.go
14
js_export.go
@ -6,20 +6,20 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
jsmod.Register("rand", map[string]any{
|
jsmod.Register("rand", map[string]any{
|
||||||
"int": func(min, max int64) int64 {
|
"Int": func(min, max int64) int64 {
|
||||||
return Int(min, max)
|
return Int(min, max)
|
||||||
},
|
},
|
||||||
"fastInt": func(min, max int64) int64 {
|
"FastInt": func(min, max int64) int64 {
|
||||||
return FastInt(min, max)
|
return FastInt(min, max)
|
||||||
},
|
},
|
||||||
"float": func(min, max float64) float64 {
|
"Float": func(min, max float64) float64 {
|
||||||
return Float(min, max)
|
return Float(min, max)
|
||||||
},
|
},
|
||||||
"fastFloat": func(min, max float64) float64 {
|
"FastFloat": func(min, max float64) float64 {
|
||||||
return FastFloat(min, max)
|
return FastFloat(min, max)
|
||||||
},
|
},
|
||||||
"byte": Byte,
|
"Byte": Byte,
|
||||||
"bytes": Bytes,
|
"Bytes": Bytes,
|
||||||
"perm": Perm,
|
"Perm": Perm,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user