Skip to content

Commit 05c7eea

Browse files
committed
fix: ensure default pagination keywords are used when no keywords are provided
1 parent 602a624 commit 05c7eea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/openapi-ts/src/ir/pagination.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ export const DEFAULT_PAGINATION_KEYWORDS = [
88
'offset',
99
'page',
1010
'start',
11-
];
11+
] as const;
1212

1313
export function getPaginationKeywordsRegExp({
1414
keywords = DEFAULT_PAGINATION_KEYWORDS,
1515
}: Config['input']['pagination'] = {}): RegExp {
16+
if (keywords.length === 0) {
17+
keywords = DEFAULT_PAGINATION_KEYWORDS;
18+
}
1619
const pattern = `^(${keywords.join('|')})$`;
1720
return new RegExp(pattern);
1821
}

0 commit comments

Comments
 (0)