Skip to content

Commit 16fb3c7

Browse files
authored
Merge pull request #2170 from hey-api/fix/export-default-pagination-keywords
fix: export default pagination keywords
2 parents 7365e4a + c18dd1e commit 16fb3c7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.changeset/serious-masks-talk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
fix: export default pagination keywords

packages/openapi-ts/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export const defineConfig = async (config: Configs): Promise<UserConfig> =>
101101
typeof config === 'function' ? await config() : config;
102102

103103
export { defaultPlugins } from './initConfigs';
104+
export { defaultPaginationKeywords } from './ir/pagination';
104105
export type { IR } from './ir/types';
105106
export type { OpenApi, OpenApiSchemaObject } from './openApi/types';
106107
export { clientDefaultConfig } from './plugins/@hey-api/client-core/config';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Config } from '../types/config';
22
import type { IR } from './types';
33

4-
export const DEFAULT_PAGINATION_KEYWORDS = [
4+
export const defaultPaginationKeywords = [
55
'after',
66
'before',
77
'cursor',
@@ -11,10 +11,10 @@ export const DEFAULT_PAGINATION_KEYWORDS = [
1111
] as const;
1212

1313
export function getPaginationKeywordsRegExp({
14-
keywords = DEFAULT_PAGINATION_KEYWORDS,
14+
keywords = defaultPaginationKeywords,
1515
}: Config['input']['pagination'] = {}): RegExp {
1616
if (!keywords.length) {
17-
keywords = DEFAULT_PAGINATION_KEYWORDS;
17+
keywords = defaultPaginationKeywords;
1818
}
1919
const pattern = `^(${keywords.join('|')})$`;
2020
return new RegExp(pattern);

0 commit comments

Comments
 (0)