jsonset

package
v0.0.0-...-d887429 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

func Difference(lhs, rhs []byte) ([]byte, error)

Difference removes the subset rhs from the lhs. If both are objects, remove the subset of the same keyed value, recursively, until reach to a non-object value for either lhs or rhs (regardless of the values), that key will be removed from lhs. If this is the last key in lhs, it will be removed one level upwards.

func Disjointed

func Disjointed(lhs, rhs []byte) (bool, error)

Disjointed tells whether two valid json values are disjointed. They are disjointed in one of the following cases:

  • Both are objects: Having different sets of keys, or the values of the common key are disjointed.
  • Otherwise, the two json values are regarded jointed, including both values have different types, or different values.

func NullifyObject

func NullifyObject(b []byte) ([]byte, error)

NullifyObject returns the json object, with value nullified, recursively. If the input is not a json object, nil is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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