Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomConfig ¶
RandomConfig returns a randomly generated *Config.
func StructToMap ¶
StructToMap converts any struct to a map[string]any via JSON round-trip.
func TransformToHybridCase ¶
TransformToHybridCase transforms the input string s into a hybrid case string. It uses randomness to decide, for each gap between words, whether to insert an underscore ("_"), a hyphen ("-"), or no separator at all. When no separator is chosen, if the last character of the previous word and the first character of the next word are both lowercase (which might merge the words indistinguishably), then the empty separator is overridden with either a hyphen or underscore. The forced choice uses hyphenRatio: with probability hyphenRatio a hyphen is used, otherwise an underscore. The function accepts an optional RNG argument (variadic); if none is provided, a default RNG is used.
Types ¶
type Dirtifier ¶
type Dirtifier struct {
// contains filtered or unexported fields
}
Dirtifier makes dirty JSONs from clean ones.
func NewDirtifier ¶
NewDirtifier creates a new dirtifier.
type DirtifyCfg ¶
type DirtifyCfg struct {
// contains filtered or unexported fields
}
func (*DirtifyCfg) Config ¶
func (dcfg *DirtifyCfg) Config() *config.Config