Skip to main content
Module

x/fun/string.ts>isString

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function isString
import { isString } from "https://deno.land/x/fun@v2.0.0/string.ts";

A instance of Refinement<unknown, string>. Used as a type guard to verify any type is actually a string.

Examples

Example 1

import { isString } from "./string.ts";

const notString: unknown = 2;
const string: unknown = "hello";

const result1 = isString(notString); // result1 has type unknown
const result2 = isString(string); // result2 has type string

Parameters

a: unknown

Returns

a is string