Skip to main content

Module preview

Module preview 

Source
Expand description

Bounded previews and caps for mismatch warnings.

Constants§

SHADOW_LOG_DIFF_MAX_BYTES
Maximum UTF-8 bytes of a logged diff_json.
SHADOW_LOG_KEY_MAX_BYTES
Maximum UTF-8 bytes of a logged cache key.
SHADOW_LOG_TRUNCATION_MARKER
Marker appended to a clamped preview.
SHADOW_LOG_VALUE_MAX_BYTES
Maximum UTF-8 bytes of a logged value preview.
SHADOW_MISMATCH_MAX_DEPTH
Reference tokens in the deepest pointer the built-in walk reports.
SHADOW_MISMATCH_MAX_ENTRIES
Most difference entries a warning lists; mismatch_path_count keeps the uncut total.
SHADOW_MISMATCH_PATH_MAX_BYTES
Maximum UTF-8 bytes of one logged JSON Pointer.
SHADOW_MISMATCH_SIDE_MAX_BYTES
Maximum UTF-8 bytes of one entry side’s JSON in diff_json; a longer side is logged as its clamped JSON text.

Functions§

clamp_utf8
Clamp text to max_bytes of UTF-8, ending a clamped result with the truncation marker on a character boundary.
preview_key
Clamp a logical key to SHADOW_LOG_KEY_MAX_BYTES.
preview_value
Clamp a value’s JSON preview to SHADOW_LOG_VALUE_MAX_BYTES.