mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
MISC: Remove isString utility function (#1185)
This commit is contained in:
@@ -1,13 +1,3 @@
|
||||
// We can probably get rid of isString in favor of just checking typeof value==="string".
|
||||
// We are not and should not ever be using `new String()` for anything. Will remove in 2.3.1
|
||||
/**
|
||||
* Checks whether the value passed in can be considered a string.
|
||||
* @param value The value to check if it is a string.
|
||||
*/
|
||||
export function isString(value: unknown): value is string {
|
||||
return typeof value === "string" || value instanceof String;
|
||||
}
|
||||
|
||||
/** Removes a single layer of matching single or double quotes, if present. */
|
||||
export function trimQuotes(value: string): string {
|
||||
if (value.length < 2) return value;
|
||||
|
||||
Reference in New Issue
Block a user