import { isNumber } from './isNumber.js';
/**
 * Convert request JoinQuery object from strings to numbers
 * @param joins
 */ export const sanitizeJoinParams = (joins = {})=>{
    const joinQuery = {};
    Object.keys(joins).forEach((schemaPath)=>{
        if (joins[schemaPath] === 'false' || joins[schemaPath] === false) {
            joinQuery[schemaPath] = false;
        } else {
            joinQuery[schemaPath] = {
                limit: isNumber(joins[schemaPath]?.limit) ? Number(joins[schemaPath].limit) : undefined,
                sort: joins[schemaPath]?.sort ? joins[schemaPath].sort : undefined,
                where: joins[schemaPath]?.where ? joins[schemaPath].where : undefined
            };
        }
    });
    return joinQuery;
};

//# sourceMappingURL=sanitizeJoinParams.js.map