MCPcopy
hub / github.com/bernaferrari/FigmaToCode / indentString

Function indentString

packages/backend/src/common/indentString.ts:2–10  ·  view source on GitHub ↗
(str: string, indentLevel: number = 2)

Source from the content-addressed store, hash-verified

1// From https://github.com/sindresorhus/indent-string
2export const indentString = (str: string, indentLevel: number = 2): string => {
3 // const options = {
4 // includeEmptyLines: false,
5 // };
6
7 // const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
8 const regex = /^(?!\s*$)/gm;
9 return str.replace(regex, " ".repeat(indentLevel));
10};
11
12export const indentStringFlutter = (
13 str: string,

Callers 15

getFullAppTemplateFunction · 0.90
getStatelessTemplateFunction · 0.90
tailwindWrapSVGFunction · 0.90
tailwindGroupFunction · 0.90
tailwindContainerFunction · 0.90
tailwindSectionFunction · 0.90
generateReactComponentFunction · 0.90
htmlWrapSVGFunction · 0.90
htmlGroupFunction · 0.90
htmlContainerFunction · 0.90
htmlSectionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected