def csv_of
import cswap-bend-cli@0.1.0.0/fmt/shape.bend as Shapeimport Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
253# The CSV text of a command's document. `key` names the command shape
254# (list, status, config-list, profile-list, export); a document that is an
255# error envelope is always one wide row.
256def csv_of(+key: String, +j: Json.Json) -> String:
257 Bool.pick(String, has_error(j), wide(j), by_key(key, j))