MCPcopy Create free account
hub / github.com/conforma/cli / filterMatchedByRegexp

Function filterMatchedByRegexp

acceptance/cli/cli.go:583–594  ·  view source on GitHub ↗
(obj any, diff gojsondiff.Diff)

Source from the content-addressed store, hash-verified

581}
582
583func filterMatchedByRegexp(obj any, diff gojsondiff.Diff) diffy {
584 deltas := diff.Deltas()
585 if v, ok := obj.(map[string]any); ok {
586 filterObjectMatchedByRegexp(v, &deltas)
587 } else if v, ok := obj.([]any); ok {
588 filterArrayMatchedByRegexp(v, &deltas)
589 }
590
591 filterOutEmptyDeltas(&deltas)
592
593 return deltas
594}
595
596func filterOutEmptyDeltas(deltas *[]gojsondiff.Delta) {
597 filtered := make([]gojsondiff.Delta, 0, len(*deltas))

Callers 2

Test_JSONDiffWithRegexFunction · 0.85

Calls 4

filterOutEmptyDeltasFunction · 0.85
DeltasMethod · 0.80

Tested by 1

Test_JSONDiffWithRegexFunction · 0.68