Skip to content

Commit

Permalink
fix-spread-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
uriva committed Aug 13, 2023
1 parent 4ec389c commit d29a757
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/operator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BooleanEquivalent } from "./typing.ts";
import { BooleanEquivalent, Func } from "./typing.ts";

export const letIn = <T, Output>(value: T, constructor: (input: T) => Output) =>
constructor(value);
Expand All @@ -16,7 +16,5 @@ export const between = (start: number, end: number) => (x: number) =>
start <= x && x < end;
export const unspread = <Inputs extends unknown[]>(...stuff: Inputs): Inputs =>
stuff;
export const spread =
<Func extends (..._: unknown[]) => unknown>(f: Func) =>
(x: Parameters<Func>) => f(...x);
export const spread = <F extends Func>(f: F) => (x: Parameters<F>) => f(...x);
export const modulo = (y: number) => (x: number) => x % y;

0 comments on commit d29a757

Please sign in to comment.