30 lines
415 B
Go
30 lines
415 B
Go
package sq
|
|
|
|
import "maps"
|
|
|
|
import "git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
|
|
type PP map[string]any
|
|
|
|
func Join(pps ...PP) PP {
|
|
r := PP{}
|
|
for _, add := range pps {
|
|
maps.Copy(r, add)
|
|
}
|
|
return r
|
|
}
|
|
|
|
func (pp *PP) Add(v any) string {
|
|
id := PPID()
|
|
(*pp)[id] = v
|
|
return id
|
|
}
|
|
|
|
func (pp *PP) AddAll(other PP) {
|
|
maps.Copy((*pp), other)
|
|
}
|
|
|
|
func PPID() string {
|
|
return "p_" + langext.RandBase62(8)
|
|
}
|