index.js
function decimal(name) {
  return joi.alternatives().meta({ cql: true, type: name }).try(
    // a string that represents a number that is larger than JavaScript can handle
    joi.string().regex(/^\-?\d+(\.\d+)?$/m),
    // any number that can be represented in JavaScript
    joi.number()
  );
}
function decimal(name) {
  return joi.alternatives().meta({ cql: true, type: name }).try(
    // a string that represents a number that is larger than JavaScript can handle
    joi.string().regex(/^\-?\d+(\.\d+)?$/m),
    // any number that can be represented in JavaScript
    joi.number()
  );
}
function decimal ( name ) { return joi . alternatives ( ) . meta ( { cql : true , type : name } ) . try ( // a string that represents a number that is larger than JavaScript can handle joi . string ( ) . regex ( / ^\-?\d+(\.\d+)?$ / m ) , // any number that can be represented in JavaScript joi . number ( ) ) ; }
Used for creating decimal with string and number alternative formats

@param {String} name - the type of decimal value
@returns {Joi} - the validator
Used for creating decimal with string and number alternative formats