Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

unary

import { unary } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn.ts";

Take a variadic Fn and make it unary, collapsing multiple arguments into a single tuple argument.

@example
import * as F from "./fn.ts";

const person = (age: number, name: string) => ({ age, name });
const personUnary = F.unary(person);

// ({ name: "Brandon", age: 37 })
const result1 = personUnary([37, "Brandon"]);
function unary<D extends unknown[], A>(fda: (...d: D) => A): Fn<D, A>;
§
unary<D extends unknown[], A>(fda: (...d: D) => A): Fn<D, A>
[src]

§Type Parameters

§
D extends unknown[]
[src]

§Parameters

§
fda: (...d: D) => A
[src]

§Return Type

§
Fn<D, A>
[src]