Documentation
¶
Overview ¶
Package value is the JSON-shaped data model shared by the script runtime and the matcher. Missing object keys are Absent, which is distinct from null.
Index ¶
- func AsInt(v any) (int, bool)
- func AsMap(v any) (map[string]any, bool)
- func AsSlice(v any) ([]any, bool)
- func Clone(v any) (any, error)
- func CompareNumbers(a, b any) (int, bool)
- func Format(v any) string
- func IsAbsent(v any) bool
- func IsNumber(v any) bool
- func JoinPath(base, next string) string
- func Kind(v any) string
- func Marshal(v any) ([]byte, error)
- func Normalize(v any) any
- func NumbersEqual(a, b any) (equal, ok bool)
- func Parse(b []byte) (any, error)
- func ParseCSV(raw string) ([]any, error)
- func Sprint(v any) string
- func Truncate(s string, limit int) string
- type Absent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareNumbers ¶
func Normalize ¶
Normalize copies v into the small set of types the matcher understands: nil, bool, int64, float64, string, []byte, []any, and map[string]any. Runtime-owned values (such as JS callbacks) stay opaque; caches validate them separately rather than sharing them across scenarios.
func NumbersEqual ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.