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

x/rambda/immutable.d.ts>unless

Faster and smaller alternative to Ramda
Latest
function unless
import { unless } from "https://deno.land/x/rambda@9.4.1/immutable.d.ts";

The method returns function that will be called with argument input.

If predicate(input) returns false, then the end result will be the outcome of whenFalse(input).

In the other case, the final output will be the input itself.

Parameters

predicate: (x: T) => boolean
whenFalseFn: (x: T) => U
x: T

Parameters

predicate: (x: T) => boolean
whenFalseFn: (x: T) => U

Returns

(x: T) => T | U

Parameters

predicate: (x: T) => boolean
whenFalseFn: (x: T) => T
x: T

Parameters

predicate: (x: T) => boolean
whenFalseFn: (x: T) => T

Returns

(x: T) => T