|
|
@ -15,6 +15,7 @@ export function extractLimitAndOffset( |
|
|
|
offset?: number | string; |
|
|
|
offset?: number | string; |
|
|
|
l?: number | string; |
|
|
|
l?: number | string; |
|
|
|
o?: number | string; |
|
|
|
o?: number | string; |
|
|
|
|
|
|
|
limitOverride?: number; |
|
|
|
} = {}, |
|
|
|
} = {}, |
|
|
|
) { |
|
|
|
) { |
|
|
|
const obj: { |
|
|
|
const obj: { |
|
|
@ -40,5 +41,10 @@ export function extractLimitAndOffset( |
|
|
|
const offset = +(args.offset || args.o) || 0; |
|
|
|
const offset = +(args.offset || args.o) || 0; |
|
|
|
obj.offset = Math.max(Number.isInteger(offset) ? offset : 0, 0); |
|
|
|
obj.offset = Math.max(Number.isInteger(offset) ? offset : 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// override limit if provided
|
|
|
|
|
|
|
|
if (args.limitOverride) { |
|
|
|
|
|
|
|
obj.limit = +args.limitOverride; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return obj; |
|
|
|
return obj; |
|
|
|
} |
|
|
|
} |
|
|
|