lib/validation.helper.js
function instanceOf(validatedObject, expectedClass, errorText) {
  if (!(validatedObject instanceof expectedClass)) {
    throw new ValidationError(
      errorText || `Validated object is not an instance of ${expectedClass.name}`
    );
  }
  return validatedObject;
}
function instanceOf(validatedObject, expectedClass, errorText) {
  if (!(validatedObject instanceof expectedClass)) {
    throw new ValidationError(
      errorText || `Validated object is not an instance of ${expectedClass.name}`
    );
  }
  return validatedObject;
}
function instanceOf ( validatedObject , expectedClass , errorText ) { if ( ! ( validatedObject instanceof expectedClass ) ) { throw new ValidationError ( errorText || ` ${ expectedClass . name } ` ) ; } return validatedObject ; }
Checks value to be an instance of a given class
@param validatedObject
@param {class} expectedClass
@param {string} [errorText] - message for error thrown if validation fails
@returns {Object} validatedObject
Checks value to be an instance of a given class