/**
 * Functions to be shared across mutiple modules.
 */

/**
 * Returns the file extension of some path.
 */
export function getFileExt(path: string): string {
  return path.substr(path.lastIndexOf('.') - path.length);
}

/**
 * Returns the first defined argument. Returns null if there are no defined
 * arguments.
 */
export function getFirstDefined(...options) {
  for (var i = 0; i < arguments.length; i++) {
    if (arguments[i] !== undefined) {
      return arguments[i];
    }
  }
  return null;
}

/**
 * Functions to be shared across mutiple modules.
 */

/**
 * Returns the file extension of some path.
 */
export function getFileExt(path: string): string {
  return path.substr(path.lastIndexOf('.') - path.length);
}

/**
 * Returns the first defined argument. Returns null if there are no defined
 * arguments.
 */
export function getFirstDefined(...options) {
  for (var i = 0; i < options.length; i++) {
    if (options[i] !== undefined) {
      return options[i];
    }
  }
  return null;
}

Use options variable instead of arguments in getFirstDefined
Use options variable instead of arguments in getFirstDefined
