Skip to main content

shape_of

Function shape_of 

Source
pub fn shape_of(value: &Value) -> Value
Expand description

Reduce a JSON value to its type-shape: objects keep their keys (each mapped to the shape of its value), arrays collapse to a single-element shape, and every scalar becomes a type tag ("string", "integer", "number", "boolean", "null").

The result is itself JSON so it serializes cleanly into the committed snapshot and diffs with the same machinery.