normalize

package
v0.29.2-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONAlphabetically

func JSONAlphabetically(input string) (string, error)

JSONAlphabetically normalizes the JSON structure by recursively sorting the keys of all objects (maps) in alphabetical order. It ensures that:

  1. All keys within objects are sorted consistently across all nesting levels.
  2. Arrays (slices) retain their original order and are not sorted. However, any nested objects within arrays are normalized by sorting their keys alphabetically.

This approach preserves the semantics of JSON arrays while ensuring consistent ordering of keys in objects for easier comparison or processing.

func LikelyFromFile

func LikelyFromFile(xmlContent string) bool

likelyFromFile determines if the XML content likely came from a file This is a heuristic approach that checks for common file as source indicators

func NormalizeXML

func NormalizeXML(xmlContent string) string

NormalizeXML normalizes XML content by removing BOM, normalizing whitespace, and unescaping HTML entities for create and update constructor operations

func PreserveSecretSettings

func PreserveSecretSettings(config, resp interface{}) error

PreserveSecretSettings recursively searches through the server response for settings catalog and if a match for #microsoft.graph.deviceManagementConfigurationSecretSettingValue is found, it preserves the original secret value and state from the config settings.

func ReverseNormalizeXML

func ReverseNormalizeXML(xmlContent string) string

reverseNormalizeXMLContent reverses normalization to match original Terraform format for read stating operations

Types

This section is empty.

Jump to

Keyboard shortcuts

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