MISC: Remove isString utility function (#1185)

This commit is contained in:
catloversg
2024-03-23 16:46:52 +07:00
committed by GitHub
parent c5581e92bc
commit db226ce0b8
5 changed files with 7 additions and 21 deletions
-10
View File
@@ -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;