(input: unknown): input is stringChecks whether a value is a string.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
string.
Details
Uses typeof input === "string".
Example (Guarding strings)
import { Predicate } from "effect"
const data: unknown = "hi"
if (Predicate.isString(data)) {
console.log(data.toUpperCase())
}Source effect/Predicate.ts:5393 lines
export function function isString(
input: unknown
): input is string
Checks whether a value is a string.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
string.
Details
Uses typeof input === "string".
Example (Guarding strings)
import { Predicate } from "effect"
const data: unknown = "hi"
if (Predicate.isString(data)) {
console.log(data.toUpperCase())
}
isString(input: unknowninput: unknown): input: unknowninput is string {
return typeof input: unknowninput === "string"
}Referenced by 6 symbols