Skip to main content

Module shape

Module shape 

Source
Expand description

Stateless reshaping primitives applied to the result array of an envelope.

Every function here takes and returns plain serde_json data so a single call site in crate::output can serve every subcommand. None of them knows what a memory, an entity or a hit is.

Functions§

dedupe
Drops later elements whose scalar at key was already seen.
filter
Keeps only the elements accepted by every predicate.
limit
Truncates the list to at most max elements. 0 means “no cap”.
project
Rewrites each object element to carry only keys, in the requested order.
project_one
Projects a single value; see project.
sort
Sorts elements ascending by the scalar found at the dotted key.
truncate_strings
Shortens every string longer than max characters, recursively.