package vaultview import "git.julianfamily.org/keepassgo/internal/vault" // HiddenRoot returns the single synthetic top-level vault group that should be // treated as an internal storage root rather than as a user-visible group. func HiddenRoot(model vault.Model) string { if hasGroup(model.Groups, []string{KeepassRoot}) { return KeepassRoot } if usesTopLevelRoot(model, KeepassRoot) { return KeepassRoot } return "" } func hasGroup(groups [][]string, path []string) bool { for _, group := range groups { if len(group) != len(path) { continue } match := true for i := range group { if group[i] != path[i] { match = false break } } if match { return true } } return false }