How to use the @nestjsx/util.isNumber function in @nestjsx/util

To help you get started, we’ve selected a few @nestjsx/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nestjsx / crud / packages / crud-request / lib / request-query.validator.js View on Github external
function validateNumeric(val, num) {
    if (!util_1.isNumber(val)) {
        throw new exceptions_1.RequestQueryException(`Invalid ${num}. Number expected`);
    }
}
exports.validateNumeric = validateNumeric;
github nestjsx / crud / packages / crud-request / src / request-query.validator.ts View on Github external
export function validateNumeric(
  val: number,
  num: 'limit' | 'offset' | 'page' | 'cache' | string,
): void {
  if (!isNumber(val)) {
    throw new RequestQueryException(`Invalid ${num}. Number expected`);
  }
}