MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / orderConfigKeys

Function orderConfigKeys

pkg/wconfig/settingsconfig.go:750–766  ·  view source on GitHub ↗
(m waveobj.MetaMapType)

Source from the content-addressed store, hash-verified

748}
749
750func orderConfigKeys(m waveobj.MetaMapType) []string {
751 keys := make([]string, 0, len(m))
752 for k := range m {
753 keys = append(keys, k)
754 }
755 sort.Slice(keys, func(i, j int) bool {
756 k1 := keys[i]
757 k2 := keys[j]
758 k1ns := getConfigKeyNamespace(k1)
759 k2ns := getConfigKeyNamespace(k2)
760 if k1ns != k2ns {
761 return k1ns < k2ns
762 }
763 return k1 < k2
764 })
765 return keys
766}
767
768func reindentJson(barr []byte, indentStr string) []byte {
769 if len(barr) < 2 {

Callers 1

jsonMarshalConfigInOrderFunction · 0.85

Calls 1

getConfigKeyNamespaceFunction · 0.85

Tested by

no test coverage detected