-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move to prettier and add CI workflows
- Loading branch information
Showing
10 changed files
with
220 additions
and
236 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# These are supported funding model platforms | ||
|
||
github: "qix-" | ||
github: 'qix-' |
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,21 @@ | ||
name: Test | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Lint commit message | ||
uses: wagoid/commitlint-github-action@v4 | ||
- name: Lint source | ||
run: npm run lint | ||
- name: Test | ||
run: npm run test |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
save-exact = true | ||
package-lock = false | ||
update-notifier = false |
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
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 |
---|---|---|
@@ -1,29 +1,39 @@ | ||
type ScalyResult<ReturnValue, Error_ = string> = AsyncGenerator<Error_ | undefined, ReturnValue | void, ReturnValue>; | ||
type ScalyResult<ReturnValue, Error_ = string> = AsyncGenerator< | ||
Error_ | undefined, | ||
ReturnValue | void, | ||
ReturnValue | ||
>; | ||
|
||
type BoxedTupleTypes<T extends any[]> = | ||
{[P in keyof T]: [T[P]]}[Exclude<keyof T, keyof any[]>]; | ||
type BoxedTupleTypes<T extends any[]> = { [P in keyof T]: [T[P]] }[Exclude< | ||
keyof T, | ||
keyof any[] | ||
>]; | ||
|
||
type UnionToIntersection<U> = | ||
(U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | ||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ( | ||
k: infer I | ||
) => void | ||
? I | ||
: never; | ||
|
||
type UnboxIntersection<T> = T extends {0: infer U} ? U : never; | ||
type UnboxIntersection<T> = T extends { 0: infer U } ? U : never; | ||
|
||
declare function scaly< | ||
T, | ||
S extends any[], | ||
U = T & UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>>, | ||
U = T & UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> | ||
>( | ||
target: T, | ||
...sources: S | ||
): { | ||
[P in keyof U]: U[P] extends (...args: any[]) => ScalyResult<infer ReturnValue, infer Error_> | ||
? (...args: Parameters<U[P]>) => Promise<[true, ReturnValue] | [false, Error_]> | ||
: never | ||
[P in keyof U]: U[P] extends ( | ||
...args: any[] | ||
) => ScalyResult<infer ReturnValue, infer Error_> | ||
? ( | ||
...args: Parameters<U[P]> | ||
) => Promise<[true, ReturnValue] | [false, Error_]> | ||
: never; | ||
}; | ||
|
||
export { | ||
scaly, | ||
ScalyResult, | ||
}; | ||
export { scaly, ScalyResult }; | ||
|
||
export default scaly; |
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
Oops, something went wrong.