export const max = (value, options) => {
  if (typeof options.value === "undefined") {
    console.error('The "value" option must be specified for "max" validator.');
    return true;
  }
  if (typeof value === "undefined" || value === null) {
    return false;
  }
  const process = (v) => Number(v);
  if (Array.isArray(value)) {
    return value.every((v) => process(v) <= options.value);
  }
  return process(value) <= options.value;
};
