Skip to content

Commit

Permalink
New Build
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-mcmahon committed Oct 9, 2020
1 parent 23ee2fc commit 099c2b5
Show file tree
Hide file tree
Showing 247 changed files with 408 additions and 1,967 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions dist/app/functions/F.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const F: (...ignored: unknown[]) => false;
4 changes: 4 additions & 0 deletions dist/app/functions/F.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.F = void 0;
exports.F = (...ignored) => false;
1 change: 1 addition & 0 deletions dist/app/functions/T.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const T: (...ignored: unknown[]) => true;
4 changes: 4 additions & 0 deletions dist/app/functions/T.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.T = void 0;
exports.T = (...ignored) => true;
1 change: 1 addition & 0 deletions dist/app/functions/always.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const always: <A>(a: A) => (...bs: unknown[]) => A;
4 changes: 4 additions & 0 deletions dist/app/functions/always.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.always = void 0;
exports.always = (a) => (...bs) => a;
3 changes: 3 additions & 0 deletions dist/app/functions/assoc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const assoc: <K extends string | number | symbol>(k: K) => <B>(b: B) => <A>(a: A) => A | {
K: B;
};
5 changes: 5 additions & 0 deletions dist/app/functions/assoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assoc = void 0;
const clone_1 = require("./clone");
exports.assoc = (k) => (b) => (a) => Object.assign(clone_1.clone(a), { [k]: b });
1 change: 1 addition & 0 deletions dist/app/functions/bind.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const bind: <M extends CallableFunction>(m: M) => (b: ThisParameterType<M>) => OmitThisParameter<M>;
4 changes: 4 additions & 0 deletions dist/app/functions/bind.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bind = void 0;
exports.bind = (m) => (b) => m.bind(b);
1 change: 1 addition & 0 deletions dist/app/functions/blackbird.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const blackbird: <BS extends any[], C>(converging: (...bs: BS) => C) => <A>(...parts: ((a: A) => unknown)[]) => (a: A) => C;
7 changes: 7 additions & 0 deletions dist/app/functions/blackbird.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.blackbird = void 0;
exports.blackbird = (converging) => (...parts) => (a) => {
const bs = parts.map((part) => part(a));
return converging(...bs);
};
1 change: 1 addition & 0 deletions dist/app/functions/both.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const both: <A, B>(first: (a: A) => B) => <C>(second: (a: A) => C) => (a: A) => B | C;
4 changes: 4 additions & 0 deletions dist/app/functions/both.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.both = void 0;
exports.both = (first) => (second) => (a) => first(a) && second(a);
1 change: 1 addition & 0 deletions dist/app/functions/cap.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const cap: (word: string) => string;
6 changes: 0 additions & 6 deletions dist/functions/cap.js → dist/app/functions/cap.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cap = void 0;
/**
* ```
* cap :: s => s
* ```
* @param {string} word word we want to capitalize
*/
exports.cap = (word) => typeof word === "string" && word.length > 0
? word[0].toLocaleUpperCase() + word.substr(1)
: word;
1 change: 1 addition & 0 deletions dist/app/functions/clone.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function clone<A>(a: A): A;
23 changes: 8 additions & 15 deletions dist/functions/clone.js → dist/app/functions/clone.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use strict";
/* eslint-disable @typescript-eslint/ban-types -- WeakMap needs an object type */
Object.defineProperty(exports, "__esModule", { value: true });
exports.clone = void 0;
const functions_1 = require("../functions");
const isArray_1 = require("./isArray");
const isDate_1 = require("./isDate");
const isObject_1 = require("./isObject");
const isDefined_1 = require("./isDefined");
function cloneObject(a, map) {
if (map.has(a)) {
return map.get(a);
Expand Down Expand Up @@ -33,26 +35,17 @@ function cloneArray(a, map) {
}
}
function cloneUnknown(a, map) {
const t = functions_1.isDefined(a)
? functions_1.isDate(a)
const t = isDefined_1.isDefined(a)
? isDate_1.isDate(a)
? cloneDate(a)
: functions_1.isArray(a)
: isArray_1.isArray(a)
? cloneArray(a, map)
: functions_1.isObject(a)
: isObject_1.isObject(a)
? cloneObject(a, map)
: a
: a;
return t;
}
/**
* ```
* clone :: a => a
* ```
* @export
* @template A
* @param {A} a
* @returns {A}
*/
function clone(a) {
const map = new WeakMap();
return cloneUnknown(a, map);
Expand Down
1 change: 1 addition & 0 deletions dist/app/functions/complement.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const complement: <A>(predicate: (a: A) => boolean) => (a: A) => boolean;
4 changes: 4 additions & 0 deletions dist/app/functions/complement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.complement = void 0;
exports.complement = (predicate) => (a) => !predicate(a);
9 changes: 9 additions & 0 deletions dist/app/functions/compose.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Last } from "../types";
export declare type Compose<B, A> = {
(b: B): A;
call(a: A): B;
from<C>(f: (c: C) => B): Compose<C, A>;
};
export declare const compose: (<FS extends ((x: any) => any)[]>(...fs: FS) => (a: Parameters<Last<FS>>[0]) => ReturnType<FS[0]>) & {
fluent: <B, A>(f: (b: B) => A) => Compose<B, A>;
};
30 changes: 30 additions & 0 deletions dist/app/functions/compose.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compose = void 0;
const fluent = (f) => {
function call(b) {
return f(b);
}
const p = Object.assign(call.bind(null), {
from: (f) => {
return after(p, f);
},
call,
});
return p;
};
const after = (next, f) => {
function call(c) {
return next(f(c));
}
const p = Object.assign(call.bind(null), {
from: (f) => {
return after(p, f);
},
call,
});
return p;
};
exports.compose = Object.assign((...fs) => {
return (a) => fs.reduceRight((v, f) => f(v), a);
}, { fluent });
1 change: 1 addition & 0 deletions dist/app/functions/concat.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const concat: <A extends readonly unknown[]>(as: A) => <B extends readonly unknown[]>(bs: B) => [...A, ...B];
4 changes: 4 additions & 0 deletions dist/app/functions/concat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.concat = void 0;
exports.concat = (as) => (bs) => [...as, ...bs];
1 change: 1 addition & 0 deletions dist/app/functions/curry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const curry: <F extends Function>(f: F) => Function;
5 changes: 5 additions & 0 deletions dist/app/functions/curry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.curry = void 0;
const curryN_1 = require("./curryN");
exports.curry = (f) => curryN_1.curryN(f.length)(f);
1 change: 1 addition & 0 deletions dist/app/functions/curryN.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const curryN: (n: number) => <F extends Function>(f: F) => Function;
10 changes: 0 additions & 10 deletions dist/functions/curryN.js → dist/app/functions/curryN.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,4 @@ const gather = (n, f, previous = []) => {
});
return curried;
};
/**
* ```
* curryN :: n => ((a¹, a², ..., aⁿ) => b) => a¹ => a²... => aⁿ => b
* ```
* -----------------------------------------------------------------------------
* Converts a function that accepts an arity, __n__, number of arguments into a
* series of _Unary_ functions that produce the same final value.
*
* @todo add support for Variadic Tuples in TypeScript 4
*/
exports.curryN = (n) => (f) => gather(n, f);
1 change: 1 addition & 0 deletions dist/app/functions/defaultTo.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const defaultTo: <A>(a: A) => <B>(b: B) => A | B;
6 changes: 6 additions & 0 deletions dist/app/functions/defaultTo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultTo = void 0;
const isDefined_1 = require("./isDefined");
const isNaN_1 = require("./isNaN");
exports.defaultTo = (a) => (b) => isNaN_1.isNaN(b) ? a : isDefined_1.isDefined(b) ? b : a;
1 change: 1 addition & 0 deletions dist/app/functions/either.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const either: <A, B>(mapAB: (a: A) => B) => <C>(mapAC: (a: A) => C) => (a: A) => B | C;
4 changes: 4 additions & 0 deletions dist/app/functions/either.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.either = void 0;
exports.either = (mapAB) => (mapAC) => (a) => mapAB(a) || mapAC(a);
1 change: 1 addition & 0 deletions dist/app/functions/equals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const equals: (a: unknown) => (b: unknown) => boolean;
4 changes: 4 additions & 0 deletions dist/app/functions/equals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.equals = void 0;
exports.equals = (a) => (b) => a === b;
1 change: 1 addition & 0 deletions dist/app/functions/filter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const filter: <A>(p: (a: A) => boolean) => (as: A[]) => A[];
4 changes: 4 additions & 0 deletions dist/app/functions/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filter = void 0;
exports.filter = (p) => (as) => as.filter(p);
1 change: 1 addition & 0 deletions dist/app/functions/has.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const has: <K extends string | number | symbol>(k: K) => (a: unknown) => a is { [P in K]: unknown; };
4 changes: 4 additions & 0 deletions dist/app/functions/has.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.has = void 0;
exports.has = (k) => (a) => Object.prototype.hasOwnProperty.call(a, k);
1 change: 1 addition & 0 deletions dist/app/functions/head.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const head: <A>(as: A[]) => A;
4 changes: 4 additions & 0 deletions dist/app/functions/head.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.head = void 0;
exports.head = (as) => as[0];
1 change: 1 addition & 0 deletions dist/app/functions/identity.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const identity: <A>(a: A) => A;
4 changes: 4 additions & 0 deletions dist/app/functions/identity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.identity = void 0;
exports.identity = (a) => a;
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions dist/app/functions/iife.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const iife: <AS extends unknown[], B>(f: (...as: AS) => B, ...as: AS) => B;
4 changes: 4 additions & 0 deletions dist/app/functions/iife.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.iife = void 0;
exports.iife = (f, ...as) => f(...as);
1 change: 1 addition & 0 deletions dist/app/functions/init.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const init: <A>(as: A[]) => A[];
4 changes: 4 additions & 0 deletions dist/app/functions/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
exports.init = (as) => as.slice(0, as.length - 1);
1 change: 1 addition & 0 deletions dist/app/functions/invoker.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const invoker: <K extends string | number | symbol>(k: K) => <AS extends unknown[]>(...as: AS) => <B>(c: { [_ in K]: (...as: AS) => B; }) => B;
4 changes: 4 additions & 0 deletions dist/app/functions/invoker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.invoker = void 0;
exports.invoker = (k) => (...as) => (c) => c[k](...as);
1 change: 1 addition & 0 deletions dist/app/functions/isArray.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isArray: (arg: any) => arg is any[];
4 changes: 4 additions & 0 deletions dist/app/functions/isArray.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isArray = void 0;
exports.isArray = Array.isArray;
1 change: 1 addition & 0 deletions dist/app/functions/isDate.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isDate: (a: unknown) => a is Date;
4 changes: 4 additions & 0 deletions dist/app/functions/isDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDate = void 0;
exports.isDate = (a) => a instanceof Date;
1 change: 1 addition & 0 deletions dist/app/functions/isDefined.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isDefined: <A>(a: A) => a is Exclude<A, null> & Exclude<A, undefined>;
4 changes: 4 additions & 0 deletions dist/app/functions/isDefined.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDefined = void 0;
exports.isDefined = (a) => a != null;
1 change: 1 addition & 0 deletions dist/app/functions/isEmpty.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isEmpty: (a: unknown) => boolean;
6 changes: 6 additions & 0 deletions dist/app/functions/isEmpty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = void 0;
exports.isEmpty = (a) => (Array.isArray(a) && a.length === 0) ||
(typeof a === "string" && a.length === 0) ||
(typeof a === "object" && a !== null && Object.keys(a).length === 0);
1 change: 1 addition & 0 deletions dist/app/functions/isFunction.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isFunction: (a: unknown) => a is Function;
4 changes: 4 additions & 0 deletions dist/app/functions/isFunction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFunction = void 0;
exports.isFunction = (a) => typeof a === "function";
1 change: 1 addition & 0 deletions dist/app/functions/isNaN.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isNaN: (a: unknown) => a is number;
4 changes: 4 additions & 0 deletions dist/app/functions/isNaN.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNaN = void 0;
exports.isNaN = (a) => Number.isNaN(a);
1 change: 1 addition & 0 deletions dist/app/functions/isNil.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isNil: (a: unknown) => a is null | undefined;
4 changes: 4 additions & 0 deletions dist/app/functions/isNil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNil = void 0;
exports.isNil = (a) => a === null || a === undefined;
1 change: 1 addition & 0 deletions dist/app/functions/isNumber.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isNumber: (a: unknown) => a is number;
4 changes: 4 additions & 0 deletions dist/app/functions/isNumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNumber = void 0;
exports.isNumber = (a) => typeof a === "number";
1 change: 1 addition & 0 deletions dist/app/functions/isObject.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isObject: (a: unknown) => a is object;
4 changes: 4 additions & 0 deletions dist/app/functions/isObject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isObject = void 0;
exports.isObject = (a) => typeof a === "object";
1 change: 1 addition & 0 deletions dist/app/functions/isString.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const isString: (a: unknown) => a is string;
4 changes: 4 additions & 0 deletions dist/app/functions/isString.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isString = void 0;
exports.isString = (a) => typeof a === "string";
1 change: 1 addition & 0 deletions dist/app/functions/join.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const join: (a: string | undefined) => <A>(bs: A[]) => string;
4 changes: 4 additions & 0 deletions dist/app/functions/join.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.join = void 0;
exports.join = (a) => (bs) => bs.join(a);
1 change: 1 addition & 0 deletions dist/app/functions/last.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const last: <A>(as: A[]) => A;
4 changes: 4 additions & 0 deletions dist/app/functions/last.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.last = void 0;
exports.last = (as) => as[as.length - 1];
1 change: 1 addition & 0 deletions dist/app/functions/log.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const log: (s: string) => <A>(a: A) => A;
9 changes: 9 additions & 0 deletions dist/app/functions/log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = void 0;
exports.log = (s) => (a) => {
console.groupCollapsed(s);
console.log(a);
console.groupEnd();
return a;
};
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions dist/app/functions/merge.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const merge: <A>(a: A) => <B>(b: B) => A & B;
4 changes: 4 additions & 0 deletions dist/app/functions/merge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.merge = void 0;
exports.merge = (a) => (b) => Object.assign({}, a, b);
1 change: 1 addition & 0 deletions dist/app/functions/not.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const not: (a: unknown) => boolean;
4 changes: 4 additions & 0 deletions dist/app/functions/not.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.not = void 0;
exports.not = (a) => !a;
2 changes: 2 additions & 0 deletions dist/app/functions/partial.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const partial: <AS extends Args>(...as: AS) => <BS extends Args, C>(f: (...args_0: AS, ...args_1: BS) => C) => (...bs: BS) => C;
export declare type Args = readonly unknown[];
4 changes: 4 additions & 0 deletions dist/app/functions/partial.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.partial = void 0;
exports.partial = (...as) => (f) => (...bs) => f(...as, ...bs);
9 changes: 9 additions & 0 deletions dist/app/functions/pipe.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Last } from "../types";
export declare type Pipe<A, B> = {
(a: A): B;
then: <C>(f: (b: B) => C) => Pipe<A, C>;
invoke(a: A): B;
};
export declare const pipe: (<FS extends ((x: any) => any)[]>(...fs: FS) => (a: Parameters<FS[0]>[0]) => ReturnType<Last<FS>>) & {
fluent: <A, B>(f: (a: A) => B) => Pipe<A, B>;
};
Loading

0 comments on commit 099c2b5

Please sign in to comment.