mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 15:28:43 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -6,16 +6,16 @@
|
||||
* - Adds quotation marks around strings
|
||||
*/
|
||||
export function arrayToString<T>(a: T[]): string {
|
||||
const vals: any[] = [];
|
||||
for (let i = 0; i < a.length; ++i) {
|
||||
let elem: any = a[i];
|
||||
if (Array.isArray(elem)) {
|
||||
elem = arrayToString(elem);
|
||||
} else if (typeof elem === "string") {
|
||||
elem = `"${elem}"`;
|
||||
}
|
||||
vals.push(elem);
|
||||
const vals: any[] = [];
|
||||
for (let i = 0; i < a.length; ++i) {
|
||||
let elem: any = a[i];
|
||||
if (Array.isArray(elem)) {
|
||||
elem = arrayToString(elem);
|
||||
} else if (typeof elem === "string") {
|
||||
elem = `"${elem}"`;
|
||||
}
|
||||
vals.push(elem);
|
||||
}
|
||||
|
||||
return `[${vals.join(", ")}]`;
|
||||
return `[${vals.join(", ")}]`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user