MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / rewriteRow

Function rewriteRow

script/check-md-table-padding.ts:153–161  ·  view source on GitHub ↗
(row: string, separator: boolean)

Source from the content-addressed store, hash-verified

151}
152
153function rewriteRow(row: string, separator: boolean) {
154 // Preserve leading whitespace of the row itself (table indentation).
155 const indent = row.match(/^\s*/)![0];
156 const body = row.slice(indent.length);
157 const cells = split(body);
158 if (cells.length === 0) return row;
159 if (separator) return `${indent}|${cells.map(fixSepCell).join('|')}|`;
160 return `${indent}| ${cells.map(c => c.trim()).join(' | ')} |`;
161}
162
163function fix(file: string) {
164 const src = readFileSync(path.join(ROOT, file), 'utf8');

Callers 1

fixFunction · 0.85

Calls 2

splitFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected