MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / formatJqExpectedValue

Function formatJqExpectedValue

checks/jq.go:29–41  ·  view source on GitHub ↗
(expected api.JqExpectedResult, variables map[string]string)

Source from the content-addressed store, hash-verified

27}
28
29func formatJqExpectedValue(expected api.JqExpectedResult, variables map[string]string) string {
30 value := expected.Value
31 if expected.Type == api.JqTypeString {
32 if stringValue, ok := expected.Value.(string); ok {
33 value = InterpolateVariables(stringValue, variables)
34 }
35 }
36 encoded, err := json.Marshal(value)
37 if err != nil {
38 return fmt.Sprintf("%v", value)
39 }
40 return string(encoded)
41}
42
43func collectStdoutJqOutputs(cmd api.CLIStepCLICommand, result api.CLICommandResult) []api.CLICommandJqOutput {
44 var outputs []api.CLICommandJqOutput

Calls 1

InterpolateVariablesFunction · 0.85