import { typeOf } from '@ember/utils';
import { modifier } from 'ember-modifier';

function validatableControl(element, [isInvalid, errorMessage]) {
  if (typeOf(element.setCustomValidity) !== 'function') {
    return;
  }
  if (isInvalid) {
    element.setCustomValidity(errorMessage || 'Invalid');
  } else {
    element.setCustomValidity('');
  }
}
var validatableControl$1 = modifier(validatableControl);

export { validatableControl$1 as default };
//# sourceMappingURL=validatable-control.js.map
