We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c265e6 commit 7a6e7a5Copy full SHA for 7a6e7a5
1 file changed
packages/cli/utils/gen.ts
@@ -68,11 +68,16 @@ export const KeyFormatPatterns: Record<KeyFormat, KeyFormatPattern> = {
68
},
69
};
70
71
-export function indentLines(str: string, indent = 2, lineBreak = "\n"): string {
+export function indentLines(
72
+ str: string,
73
+ indent = 2,
74
+ lineBreak = "\n",
75
+ trim = false,
76
+): string {
77
const indentStr = " ".repeat(indent);
78
return str
79
.split(lineBreak)
- .map((line) => `${indentStr}${line.trim()}`)
80
+ .map((line) => `${indentStr}${trim ? line.trim() : line}`)
81
.join(lineBreak);
82
}
83
0 commit comments