MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / toString

Function toString

src/lib/table-generator.ts:156–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154 }
155
156 const toString = (): string => {
157 const border = {
158 topBody: '─',
159 topJoin: '',
160 topLeft: '',
161 topRight: '',
162
163 bottomBody: '─',
164 bottomJoin: '',
165 bottomLeft: '',
166 bottomRight: '',
167
168 bodyLeft: '',
169 bodyRight: '',
170 bodyJoin: '',
171
172 joinBody: '─',
173 joinLeft: '',
174 joinRight: '',
175 joinJoin: '',
176 }
177
178 const listDrawHorizontalLine = options.groupRows
179 ? (index: number) => index === 0 || index === data.length || (index - 1) % 5 === 0
180 : (index: number) => index === 0 || index === data.length || index === 1
181 const drawHorizontalLine = options.isList
182 ? listDrawHorizontalLine
183 : (index: number) => index === 0 || index === data.length
184 const config = { drawHorizontalLine, border }
185 return table(data, config)
186 }
187
188 return { push, toString }
189}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected