MCPcopy Create free account
hub / github.com/devfile/api / getCommandsMap

Function getCommandsMap

pkg/validation/utils.go:38–47  ·  view source on GitHub ↗

getCommandsMap iterates through the commands and returns a map of command

(commands []v1alpha2.Command)

Source from the content-addressed store, hash-verified

36
37// getCommandsMap iterates through the commands and returns a map of command
38func getCommandsMap(commands []v1alpha2.Command) map[string]v1alpha2.Command {
39 commandMap := make(map[string]v1alpha2.Command, len(commands))
40
41 for _, command := range commands {
42 command.Id = strings.ToLower(command.Id)
43 commandMap[command.Id] = command
44 }
45
46 return commandMap
47}
48
49// ValidateURI checks if the string is with valid uri format, return error if not valid
50func ValidateURI(uri string) error {

Callers 4

ValidateCommandsFunction · 0.85
TestIsEventValidFunction · 0.85
ValidateEventsFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestIsEventValidFunction · 0.68