mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
[refactor] Moved "isString()" to its own TS file
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { EqualityFunc } from "../src/types";
|
||||
import { dialogBoxCreate } from "./DialogBox";
|
||||
import { isString } from "./helpers/isString";
|
||||
|
||||
// Netburner String helper functions
|
||||
|
||||
@@ -63,11 +64,6 @@ function longestCommonStart(strings: string[]): string {
|
||||
return a1.substring(0, i);
|
||||
}
|
||||
|
||||
// Returns whether a variable is a string
|
||||
function isString(str: any): boolean {
|
||||
return (typeof str === "string" || str instanceof String);
|
||||
}
|
||||
|
||||
// Returns whether an array contains entirely of string objects
|
||||
function containsAllStrings(arr: string[]): boolean {
|
||||
return arr.every(isString);
|
||||
@@ -155,5 +151,5 @@ function generateRandomString(n: number): string {
|
||||
}
|
||||
|
||||
export {convertTimeMsToTimeElapsedString, longestCommonStart,
|
||||
isString, containsAllStrings, formatNumber,
|
||||
containsAllStrings, formatNumber,
|
||||
numOccurrences, numNetscriptOperators, isHTML, generateRandomString, replaceAt};
|
||||
|
||||
Reference in New Issue
Block a user