Skip to main content
Module

x/fun/string.ts>test

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 test
import { test } from "https://deno.land/x/fun@v2.0.0-alpha.10/string.ts";

Create a Predicate that returns true when it matches the supplied RegExp.

Examples

Example 1

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

const words = test(/\w+/);

const result1 = words("Hello World"); // true
const result2 = words(""); // false
const result3 = words("1234"); // true

Parameters

r: RegExp