MCPcopy Create free account
hub / github.com/algolia/cli / Differences

Function Differences

pkg/utils/utils.go:44–56  ·  view source on GitHub ↗

Differences return the elements in `a` that aren't in `b`

(a, b []string)

Source from the content-addressed store, hash-verified

42
43// Differences return the elements in `a` that aren't in `b`
44func Differences(a, b []string) []string {
45 mb := make(map[string]bool)
46 for _, x := range b {
47 mb[x] = true
48 }
49 var diff []string
50 for _, x := range a {
51 if _, ok := mb[x]; !ok {
52 diff = append(diff, x)
53 }
54 }
55 return diff
56}
57
58// ToKebabCase converts a string to kebab case
59func ToKebabCase(str string) string {

Callers 2

CheckACLsFunction · 0.92
runAddCmdFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected