function validatePathInput(
  inputElement,
  addShakeAnimationOnError = false,
  scrollIntoView = true,
  trimSpaces = true,
) {
  const val = trimSpaces ? inputElement.value.trim() : inputElement.value;

  if (val !== '' && !fs.existsSync(val)) {
    markInputAsInvalid(inputElement, addShakeAnimationOnError, scrollIntoView);
    return false;
  }

  markInputAsValid(inputElement);
  return true;
}
Checks the `inputElement` and returns `true` when the path
is valid and exists in the system.

@param {Element} inputElement
The `input` DOM Element to be validated

@param {boolean} addShakeAnimationOnError
Add animation to let the user know if the path does not exist.
_(Defaults to `false`)_

@param {boolean} scrollIntoView
Scrolls the element into view when invalid. _(Defaults to `true`)_

@param {boolean} trimSpaces
Trims leading and trailing spaces if any are present in the
path entered in `inputElement`. _(Defaults to `true`)_

@returns {boolean}
Returns boolean value (true/false) based on the validity of path