src/shared/utils/validator/index.js
function assertProperties(object, path, properties) {
  let errors = [];

  (properties || []).forEach((property) => {
    if (get(object, property, undefined) === undefined) {
      errors = [...errors, { path, id: object.id, error: `${object.type} is missing the '${property}' property` }];
    }
  });

  return errors;
}
function assertProperties(object, path, properties) {
  let errors = [];

  (properties || []).forEach((property) => {
    if (get(object, property, undefined) === undefined) {
      errors = [...errors, { path, id: object.id, error: `${object.type} is missing the '${property}' property` }];
    }
  });

  return errors;
}
function assertProperties ( object , path , properties ) { let errors = [ ] ; ( properties || [ ] ) . forEach ( ( property ) => { if ( get ( object , property , undefined ) === undefined ) { errors = [ ... errors , { path , id : object . id , error : ` ${ object . type } ${ property } ` } ] ; } } ) ; return errors ; }
Assert properties exist. Returns array of errors
Assert properties exist . Returns array of errors