Files
galaxy/client/src/utils/validation.js
T

11 lines
333 B
JavaScript

// type utils
// all args not null and not undefined
export const areDefined = (...vals) => vals.every(isDefined);
// not null and not undefined
export const isDefined = (val) => val !== undefined && val !== null;
// defined, number and finite
export const isValidNumber = (val) => isDefined(val) && !isNaN(val) && isFinite(val);