fmt/shape.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/fmt/shape.bend as Shape
3 imports
import Base import ../json.bend as Json import ./csv.bend as Csv
Types
type Col source · line 19 · raw
Data
Col@h:String -> @p:List<&2, String> -> Col
type Leaf source · line 22 · raw
Data
Leaf@k:String -> @v:String -> Leaf
Definitions
def or_null source · line 27 · raw
@m:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def get_or_null source · line 34 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+k:String -> 0x0717344745a30ebad1f19045228e8f18/json.Json
def path source · line 38 · raw
@ks:List<&2, String> -> @+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/json.Json
The value at a key path; null when any step is missing.
def is_scalar source · line 45 · raw
@j:0x0717344745a30ebad1f19045228e8f18/json.Json -> Bool
def scal source · line 55 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
A scalar as its text; a container as compact JSON.
def all_scalar source · line 68 · raw
@items:0x0717344745a30ebad1f19045228e8f18/json.Json -> Bool
def sep_of source · line 75 · raw
@t:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
def joined source · line 82 · raw
@items:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
def cell.arr source · line 89 · raw
@ok:Bool -> @+items:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
def cell source · line 96 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
def col source · line 105 · raw
@h:String -> @p:List<&2, String> -> Col
def headers source · line 108 · raw
@cols:List<&2, Col> -> List<&2, String>
def cells source · line 115 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> @cols:List<&2, Col> -> List<&2, String>
def rows source · line 122 · raw
@items:List<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @+cols:List<&2, Col> -> List<&2, List<&2, String>>
def table source · line 129 · raw
@+cols:List<&2, Col> -> @items:List<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> String
def account_cols source · line 132 · raw
List<&2, Col>
def setting_cols source · line 138 · raw
List<&2, Col>
def profile_cols source · line 141 · raw
List<&2, Col>
def event_cols source · line 145 · raw
List<&2, Col>
def event_header source · line 153 · raw
String
The header line of the auto event stream.
def event_row source · line 157 · raw
@+e:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
One event as a CSV row (no header, no line end).
def dotted source · line 162 · raw
@+prefix:String -> @+k:String -> String
def is_empty_obj source · line 165 · raw
@f:0x0717344745a30ebad1f19045228e8f18/json.Json -> Bool
def leaf.pick source · line 172 · raw
@empty:Bool -> @prefix:String -> @rest:List<&2, Leaf> -> List<&2, Leaf>
def leaves source · line 180 · raw
@j:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+prefix:String -> List<&2, Leaf>
The scalar leaves of a document with dotted keys; an array is one leaf.
def leaf_headers source · line 191 · raw
@ls:List<&2, Leaf> -> List<&2, String>
def leaf_values source · line 198 · raw
@ls:List<&2, Leaf> -> List<&2, String>
def leaf_pairs source · line 205 · raw
@ls:List<&2, Leaf> -> List<&2, List<&2, String>>
def wide.of source · line 212 · raw
@+ls:List<&2, Leaf> -> String
def wide source · line 216 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
One row: the leaves as columns.
def kv source · line 220 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
key,value rows.
def items_at source · line 225 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+k:String -> List<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def status_rows source · line 229 · raw
@a:0x0717344745a30ebad1f19045228e8f18/json.Json -> List<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json>
The active account of a status document as a list of at most one row.
def some source · line 236 · raw
@m:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Bool
def has_error source · line 243 · raw
@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> Bool
def by_key source · line 246 · raw
@+key:String -> @+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
def csv_of source · line 256 · raw
@+key:String -> @+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
The CSV text of a command's document. key names the command shape
(list, status, config-list, profile-list, export); a document that is an
error envelope is always one wide row.