mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
export function createRandomString(n: number): string {
|
||||
let str = "";
|
||||
let str = "";
|
||||
|
||||
for (let i = 0; i < n; ++i) {
|
||||
str += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
for (let i = 0; i < n; ++i) {
|
||||
str += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
|
||||
return str;
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
// For this, a 2D array is an array which contains only other arrays.
|
||||
// If one element in the array is a number or string, it is NOT a 2D array
|
||||
export function is2DArray(arr: any[]): boolean {
|
||||
if (arr.constructor !== Array) { return false; }
|
||||
if (arr.constructor !== Array) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return arr.every((e) => { return e.constructor === Array; });
|
||||
return arr.every((e) => {
|
||||
return e.constructor === Array;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
* must be a "number" type and cannot be NaN
|
||||
*/
|
||||
export function isValidNumber(n: number): boolean {
|
||||
return (typeof n === "number") && !isNaN(n);
|
||||
return typeof n === "number" && !isNaN(n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user