This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from unsplash/update-props
Update typescript to 4.4.4 and add new Imgix params
- Loading branch information
Showing
5 changed files
with
297 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.