fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2170 from hey-api/fix/export-default-pagination-keywords

fix: export default pagination keywords

authored by

Lubos and committed by
GitHub
16fb3c77 7365e4a6

+9 -3
+5
.changeset/serious-masks-talk.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: export default pagination keywords
+1
packages/openapi-ts/src/index.ts
··· 101 101 typeof config === 'function' ? await config() : config; 102 102 103 103 export { defaultPlugins } from './initConfigs'; 104 + export { defaultPaginationKeywords } from './ir/pagination'; 104 105 export type { IR } from './ir/types'; 105 106 export type { OpenApi, OpenApiSchemaObject } from './openApi/types'; 106 107 export { clientDefaultConfig } from './plugins/@hey-api/client-core/config';
+3 -3
packages/openapi-ts/src/ir/pagination.ts
··· 1 1 import type { Config } from '../types/config'; 2 2 import type { IR } from './types'; 3 3 4 - export const DEFAULT_PAGINATION_KEYWORDS = [ 4 + export const defaultPaginationKeywords = [ 5 5 'after', 6 6 'before', 7 7 'cursor', ··· 11 11 ] as const; 12 12 13 13 export function getPaginationKeywordsRegExp({ 14 - keywords = DEFAULT_PAGINATION_KEYWORDS, 14 + keywords = defaultPaginationKeywords, 15 15 }: Config['input']['pagination'] = {}): RegExp { 16 16 if (!keywords.length) { 17 - keywords = DEFAULT_PAGINATION_KEYWORDS; 17 + keywords = defaultPaginationKeywords; 18 18 } 19 19 const pattern = `^(${keywords.join('|')})$`; 20 20 return new RegExp(pattern);