Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>string.isString

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function string.isString
import { string } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { isString } = string;

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