diff options
Diffstat (limited to 'src/utils/anonymous.ts')
-rw-r--r-- | src/utils/anonymous.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils/anonymous.ts b/src/utils/anonymous.ts index ddd28bd..58e5a0a 100644 --- a/src/utils/anonymous.ts +++ b/src/utils/anonymous.ts @@ -23,3 +23,4 @@ export const pass = <T>(fn: (x: T) => void): (x: T) => T => (x: T): T => { export const equal = <T>(x: T): (y: T) => boolean => (y: T): boolean => x === y; export const extremeBy = (arr: number[], mode: "max" | "min"): number => Math[mode](...arr); +export const transform = <T, U>(x: T, y: (x: T) => U): U => y(x); |