Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from unsplash/update-props
Browse files Browse the repository at this point in the history
Update typescript to 4.4.4 and add new Imgix params
  • Loading branch information
nim442 authored Nov 12, 2021
2 parents f4d122b + 2ba2119 commit bde046b
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 182 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
"url-transformers": "^0.0.10"
},
"devDependencies": {
"prettier": "^1.15.3",
"prettier": "^2.4.1",
"rollup": "^2.7.2",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-typescript2": "^0.27.0",
"rollup-plugin-typescript2": "^0.30.0",
"source-map-support": "^0.5.9",
"tslib": "^2.3.1",
"tslint": "^5.11.0",
"tslint-language-service": "^0.9.9",
"tslint-no-unused": "^0.2.0-alpha.1",
"typescript": "^3.2.2"
"typescript": "^4.4.4"
}
}
116 changes: 116 additions & 0 deletions src/helpers/flow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Copied from
// https://github.com/gcanti/fp-ts/blob/master/src/function.ts#L230
/**
* @function
* @since 2.11.5
*/
export function flow<A extends ReadonlyArray<unknown>, B>(ab: (...a: A) => B): (...a: A) => B;
export function flow<A extends ReadonlyArray<unknown>, B, C>(
ab: (...a: A) => B,
bc: (b: B) => C,
): (...a: A) => C;
export function flow<A extends ReadonlyArray<unknown>, B, C, D>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
): (...a: A) => D;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
): (...a: A) => E;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E, F>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
ef: (e: E) => F,
): (...a: A) => F;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E, F, G>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
ef: (e: E) => F,
fg: (f: F) => G,
): (...a: A) => G;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E, F, G, H>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
ef: (e: E) => F,
fg: (f: F) => G,
gh: (g: G) => H,
): (...a: A) => H;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E, F, G, H, I>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
ef: (e: E) => F,
fg: (f: F) => G,
gh: (g: G) => H,
hi: (h: H) => I,
): (...a: A) => I;
export function flow<A extends ReadonlyArray<unknown>, B, C, D, E, F, G, H, I, J>(
ab: (...a: A) => B,
bc: (b: B) => C,
cd: (c: C) => D,
de: (d: D) => E,
ef: (e: E) => F,
fg: (f: F) => G,
gh: (g: G) => H,
hi: (h: H) => I,
ij: (i: I) => J,
): (...a: A) => J;
export function flow(
ab: Function,
bc?: Function,
cd?: Function,
de?: Function,
ef?: Function,
fg?: Function,
gh?: Function,
hi?: Function,
ij?: Function,
): unknown {
switch (arguments.length) {
case 1:
return ab;
case 2:
return function (this: unknown) {
return bc!(ab.apply(this, arguments));
};
case 3:
return function (this: unknown) {
return cd!(bc!(ab.apply(this, arguments)));
};
case 4:
return function (this: unknown) {
return de!(cd!(bc!(ab.apply(this, arguments))));
};
case 5:
return function (this: unknown) {
return ef!(de!(cd!(bc!(ab.apply(this, arguments)))));
};
case 6:
return function (this: unknown) {
return fg!(ef!(de!(cd!(bc!(ab.apply(this, arguments))))));
};
case 7:
return function (this: unknown) {
return gh!(fg!(ef!(de!(cd!(bc!(ab.apply(this, arguments)))))));
};
case 8:
return function (this: unknown) {
return hi!(gh!(fg!(ef!(de!(cd!(bc!(ab.apply(this, arguments))))))));
};
case 9:
return function (this: unknown) {
return ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab.apply(this, arguments)))))))));
};
}
return;
}
70 changes: 0 additions & 70 deletions src/helpers/pipe.ts

This file was deleted.

Loading

0 comments on commit bde046b

Please sign in to comment.