Skip to content

Commit 0c429c5

Browse files
committed
indent lines in output with 4 spaces
1 parent f380420 commit 0c429c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

buildFromTernDefinition.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ request.get("/scriptable.json")
194194
return `${str}\n${prop.definition};`;
195195
})
196196
.join("\n\n")
197-
.replace(/^/gm, "\t");
197+
.replace(/^(?!$)/gm, " ");
198198
// add } and if it is a var, also a ;
199199
str += `\n}${symbol.type === "var" ? ";" : ""}\n`;
200200
}
201201

202202
if (interfaces.length) {
203203
let ints = `declare namespace ${symbol.name} {
204-
${interfaces.map((i) => `interface ${i}`).join("\n").replace(/^/gm, "\t")}
204+
${interfaces.map((i) => `interface ${i}`).join("\n").replace(/^(?!$)/gm, " ")}
205205
}
206206
207207
`;
@@ -447,7 +447,7 @@ function processDescription(obj, options) {
447447
let t = typeof (v == null ? "" : v);
448448
!types.includes(t) && types.push(t);
449449
return t;
450-
}, "\t").replace(/"(\w+)"(:\s*)"([a-zA-Z]+)",?/g, (match, p1, p2, p3) => {
450+
}, " ").replace(/"(\w+)"(:\s*)"([a-zA-Z]+)",?/g, (match, p1, p2, p3) => {
451451
let optional =
452452
keysAreRequired === true ?
453453
!optionalOrRequiredKeys.includes(p1) :

0 commit comments

Comments
 (0)