pub fn extract_items(
data: Option<&Value>,
text: &str,
) -> Result<Vec<String>, String>Expand description
Extract items from structured data or text.
Structured .data (a JSON array from split/seq/glob/find) wins and fans out
element-by-element. Plain-text stdin is split on newlines only — one item per
line — matching the for-loop $(cmd) contract (docs/plan-for-loop-newline-split.md):
trailing newlines are trimmed once (no phantom tail item), each line’s trailing
\r is stripped, interior blank lines are preserved, and whitespace within a
line is never split. Empty / newline-only input yields zero items.