2023-05-02 10:33:06 -05:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-04-21 02:51:55 -05:00
|
|
|
package differ
|
|
|
|
|
|
|
|
import (
|
2023-08-17 07:45:11 -05:00
|
|
|
"github.com/placeholderplaceholderplaceholder/opentf/internal/command/jsonformat/computed"
|
|
|
|
"github.com/placeholderplaceholderplaceholder/opentf/internal/command/jsonformat/structured"
|
2023-04-21 02:51:55 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// asDiff is a helper function to abstract away some simple and common
|
|
|
|
// functionality when converting a renderer into a concrete diff.
|
|
|
|
func asDiff(change structured.Change, renderer computed.DiffRenderer) computed.Diff {
|
|
|
|
return computed.NewDiff(renderer, change.CalculateAction(), change.ReplacePaths.Matches())
|
|
|
|
}
|