Skip to content

Commit 18e622d

Browse files
committed
REF: pickHeaders rearrangement, simple case goes last, fixes coverage.
1 parent 22f6563 commit 18e622d

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

express-zod-api/src/logical-container.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ type Combination<T> = T[];
2424
export type Alternatives<T> = Array<Combination<T>>;
2525

2626
const pickHeaders = (container: LogicalContainer<Security>): string[] => {
27-
if (isSimple(container)) {
28-
return "type" in container && container.type === "header"
29-
? [container.name]
30-
: [];
31-
}
3227
if (isLogicalAnd(container)) return R.chain(pickHeaders, container.and);
3328
if (isLogicalOr(container)) return R.chain(pickHeaders, container.or);
29+
if (container.type === "header") return [container.name];
3430
return [];
3531
};
3632

0 commit comments

Comments
 (0)