xdiff

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flatten

func Flatten(v any) map[string]any

Flatten converts any nested maps/slices into dot/bracket paths → values.

func FlattenJSON

func FlattenJSON(data []byte) (map[string]any, error)

FlattenJSON decodes raw JSON bytes and flattens into dot-paths.

func FlattenYAML

func FlattenYAML(data []byte) (map[string]any, error)

FlattenYAML decodes YAML bytes and flattens into dot-paths.

func LoadAndFlatten

func LoadAndFlatten(path string) (map[string]any, error)

LoadAndFlatten loads a file with extension-based decoding (json|yaml|yml).

func MapDiff

func MapDiff(before, after map[string]any) ([]PathChange, []PathChange, []PathChange)

MapDiff computes added/removed/updated by comparing two flattened maps (path → value). Returns three sorted slices.

Types

type PathChange

type PathChange struct {
	Path      string
	BeforeAny any
	AfterAny  any
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL