Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function validateNumeric(val, num) {
if (!util_1.isNumber(val)) {
throw new exceptions_1.RequestQueryException(`Invalid ${num}. Number expected`);
}
}
exports.validateNumeric = validateNumeric;
export function validateNumeric(
val: number,
num: 'limit' | 'offset' | 'page' | 'cache' | string,
): void {
if (!isNumber(val)) {
throw new RequestQueryException(`Invalid ${num}. Number expected`);
}
}