File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ import * as merge from "deepmerge";
4
4
export const combineResolvers = ( resolvers = [ ] ) => resolvers
5
5
. reduce ( ( combined , resolver ) => merge ( combined , resolver ) ) ;
6
6
7
+ // Accepts multiple authentication resolvers and returns a function which will be called
8
+ // if all of the authentication resolvers succeed, or throw an error if one of them fails
7
9
export const and = ( ...conditions ) => resolver => {
8
10
return conditions . reduceRight ( ( p , c ) => {
9
11
return c . createResolver ( p ) ;
10
12
} , resolver )
11
13
}
12
14
15
+ // Accepts multiple authentication resolvers and returns a function which will be called
16
+ // if any of the authentication resolvers succeed, or throw an error if all of them fail
13
17
export const or = ( ...conditions ) => resolver => ( ...query ) => {
14
18
return new Promise ( ( resolve , reject ) => {
15
19
let limit = conditions . length - 1 ;
You can’t perform that action at this time.
0 commit comments