MCPcopy
hub / github.com/rohitdhas/shittier / addInconsistentIndentation

Function addInconsistentIndentation

src/utils/cst-formatter/white-space.ts:3–14  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

1import { Token } from 'cst';
2
3function addInconsistentIndentation(code: string) {
4 const lines = code.split('\n');
5 for (let i = 0; i < lines.length; i++) {
6 const text = lines[i].trim();
7
8 if (text !== '') {
9 const indentation = getRandomWhitespace();
10 lines[i] = indentation + text;
11 }
12 }
13 return lines.join('\n');
14}
15
16function addRandomWhiteSpace(code: any) {
17 code.selectTokensByType('Punctuator').forEach((token: any) => {

Callers 1

shittifyFunction · 0.90

Calls 1

getRandomWhitespaceFunction · 0.85

Tested by

no test coverage detected