effect-io-ai

Package: effect
Module: Predicate

Predicate.isString

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())
}

See

Signature

declare const isString: (input: unknown) => input is string

Source

Since v2.0.0