How to use the is_js.above function in is_js

To help you get started, we’ve selected a few is_js 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 Albert-Gao / veasy / src / ruleHandlers / stringRules.js View on Github external
export const minLength = (name, value, schema) => ({
  isValid: is.equal(value.length, schema.minLength) || is.above(value.length, schema.minLength),
  errorText: `${name}'s length should be equal or greater than ${schema.minLength}. Current: ${value.length}`
});
github Albert-Gao / veasy / src / stringHandlers.js View on Github external
export function minLengthHandler(value, schema) {
  const isValid = is.above(value.length, schema.minLength);

  if (isValid) return;

  const errorText = `${NAME_PLACEHOLDER}'s length should be greater than ${schema.minLength}. Current: ${value.length}`;
  throwError(value, errorText);
}
github Albert-Gao / veasy / src / numberHandlers.js View on Github external
export function minHandler(value, schema) {
  const isValid = is.above(value * 1, schema.min * 1);

  if (isValid) return;

  const errorText = `${NAME_PLACEHOLDER} should be greater than ${schema.min}. Current: ${value}`;
  throwError(value, errorText);
}
github Albert-Gao / veasy / src / ruleHandlers / numberRules.js View on Github external
export const min = (name, value, schema) => ({
  isValid: is.above(value * 1, schema.min * 1),
  errorText: `${name} should be greater than ${schema.min}. Current: ${value}`
});