Skip to content

Commit 1a06a0e

Browse files
committed
Adding comments above conditional functions
1 parent 43f573e commit 1a06a0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/helper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import * as merge from "deepmerge";
44
export const combineResolvers = (resolvers = []) => resolvers
55
.reduce((combined, resolver) => merge(combined, resolver));
66

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
79
export const and = (...conditions) => resolver => {
810
return conditions.reduceRight((p, c) => {
911
return c.createResolver(p);
1012
}, resolver)
1113
}
1214

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
1317
export const or = (...conditions) => resolver => (...query) => {
1418
return new Promise((resolve, reject) => {
1519
let limit = conditions.length - 1;

0 commit comments

Comments
 (0)