@@ -17,6 +17,7 @@ import {
1717} from '../../../generate/services' ;
1818import { relativeModulePath } from '../../../generate/utils' ;
1919import type { IROperationObject } from '../../../ir/ir' ;
20+ import { paginationKeywordsRegExp } from '../../../ir/pagination' ;
2021import { isOperationParameterRequired } from '../../../openApi' ;
2122import { getOperationKey } from '../../../openApi/common/parser/operation' ;
2223import type {
@@ -101,8 +102,6 @@ const getPaginationIn = (parameter: OperationParameter) => {
101102 }
102103} ;
103104
104- const paginationWordsRegExp = / ^ ( c u r s o r | o f f s e t | p a g e | s t a r t ) / ;
105-
106105const createInfiniteParamsFn = 'createInfiniteParams' ;
107106const createQueryKeyFn = 'createQueryKey' ;
108107const infiniteQueryOptionsFn = 'infiniteQueryOptions' ;
@@ -903,8 +902,8 @@ export const handlerLegacy: PluginLegacyHandler<
903902 let paginationField ! : Model | OperationParameter ;
904903
905904 const paginationParameter = operation . parameters . find ( ( parameter ) => {
906- paginationWordsRegExp . lastIndex = 0 ;
907- if ( paginationWordsRegExp . test ( parameter . name ) ) {
905+ paginationKeywordsRegExp . lastIndex = 0 ;
906+ if ( paginationKeywordsRegExp . test ( parameter . name ) ) {
908907 paginationField = parameter ;
909908 return true ;
910909 }
@@ -919,17 +918,17 @@ export const handlerLegacy: PluginLegacyHandler<
919918 ( model ) => model . meta ?. $ref === ref ,
920919 ) ;
921920 return refModel ?. properties . find ( ( property ) => {
922- paginationWordsRegExp . lastIndex = 0 ;
923- if ( paginationWordsRegExp . test ( property . name ) ) {
921+ paginationKeywordsRegExp . lastIndex = 0 ;
922+ if ( paginationKeywordsRegExp . test ( property . name ) ) {
924923 paginationField = property ;
925924 return true ;
926925 }
927926 } ) ;
928927 }
929928
930929 return parameter . properties . find ( ( property ) => {
931- paginationWordsRegExp . lastIndex = 0 ;
932- if ( paginationWordsRegExp . test ( property . name ) ) {
930+ paginationKeywordsRegExp . lastIndex = 0 ;
931+ if ( paginationKeywordsRegExp . test ( property . name ) ) {
933932 paginationField = property ;
934933 return true ;
935934 }
0 commit comments