Skip to main content
Module

x/fuzzy_octo_guacamole/mod.ts

A playground for testing CI setup that deploys on Deno and NPM
Go to Latest
import * as fuzzyOctoGuacamole from "https://deno.land/x/fuzzy_octo_guacamole@v2.0.0/mod.ts";

Variables

match creates a pattern matching expression.

P._ is a wildcard pattern, matching any value. It's an alias to P.any.

P.any is a wildcard pattern, matching any value.

P.bigint is a wildcard pattern matching any bigint.

P.boolean is a wildcard pattern matching any boolean.

P.nullish is a wildcard pattern matching null or undefined.

P.number is a wildcard pattern matching any number.

P.string is a wildcard pattern matching any string.

P.symbol is a wildcard pattern matching any symbol.

P._ is a wildcard pattern, matching any value. It's an alias to P.any.

P.any is a wildcard pattern, matching any value.

P.bigint is a wildcard pattern matching any bigint.

P.boolean is a wildcard pattern matching any boolean.

P.nullish is a wildcard pattern matching null or undefined.

P.number is a wildcard pattern matching any number.

P.string is a wildcard pattern matching any string.

P.symbol is a wildcard pattern matching any symbol.

Functions

isMatching takes pattern and returns a type guard function, cheching if a value matches this pattern.

P.array(subpattern) takes a sub pattern and returns a pattern, which matches arrays if all their elements match the sub pattern.

P.instanceOf(SomeClass) is a pattern matching instances of a given class.

P.intersection(...patterns) returns a pattern which matches only if every patterns provided in parameter match the input.

P.not(pattern) returns a pattern which matches if the sub pattern doesn't match.

P.optional(subpattern) takes a sub pattern and returns a pattern which matches if the key is undefined or if it is defined and the sub pattern matches its value.

P.select() is a pattern which will always match, and will inject the selected piece of input in the handler function.

P.typed<SomeType>() is a way to set the input type this pattern should match on.

P.union(...patterns) returns a pattern which matches if at least one of the patterns provided in parameter match the input.

P.array(subpattern) takes a sub pattern and returns a pattern, which matches arrays if all their elements match the sub pattern.

P.instanceOf(SomeClass) is a pattern matching instances of a given class.

P.intersection(...patterns) returns a pattern which matches only if every patterns provided in parameter match the input.

P.not(pattern) returns a pattern which matches if the sub pattern doesn't match.

P.optional(subpattern) takes a sub pattern and returns a pattern which matches if the key is undefined or if it is defined and the sub pattern matches its value.

P.select() is a pattern which will always match, and will inject the selected piece of input in the handler function.

P.typed<SomeType>() is a way to set the input type this pattern should match on.

P.union(...patterns) returns a pattern which matches if at least one of the patterns provided in parameter match the input.

Type Aliases

P.infer<typeof somePattern> will return the type of the value matched by this pattern.

Pattern<a> is the generic type for patterns matching a value of type a. A pattern can be any (nested) javascript value.

P.infer<typeof somePattern> will return the type of the value matched by this pattern.

Pattern<a> is the generic type for patterns matching a value of type a. A pattern can be any (nested) javascript value.