export const paginationRequest = <
const def extends object,
$ = {},
>(
filter?: type.validate<def, $>,
) => {
return type("<t>", {
page: "number.integer > 0",
limit: "number.integer > 0",
filter: "t", // Also i want this field won't appear if filter value is undefined in function
})(
filter // Here's type error: Type string is not assignable to type validateTuple<[def], {}, bindThis<[def]>>
);
};
export const paginationRequest = <
const def extends object,
$ = {},
>(
filter?: type.validate<def, $>,
) => {
return type("<t>", {
page: "number.integer > 0",
limit: "number.integer > 0",
filter: "t", // Also i want this field won't appear if filter value is undefined in function
})(
filter // Here's type error: Type string is not assignable to type validateTuple<[def], {}, bindThis<[def]>>
);
};