"use strict"; const { validateValue } = require("@validatem/core"); const isNumeric = require("./"); console.log(validateValue("42", [ isNumeric() ])); // 42 console.log(validateValue("42.42", [ isNumeric({ allowDecimal: true }) ])); // 42.42 try { console.log(validateValue("foo", [ isNumeric({ allowDecimal: true }) ])); } catch (error) { console.log(error.stack); /* AggregrateValidationError: One or more validation errors occurred: - At (root): Must be a string representing a positive, ungrouped number */ } console.log(validateValue("42.42", [ isNumeric() ])); /* AggregrateValidationError: One or more validation errors occurred: - At (root): Must be a string representing a whole, positive, ungrouped number */