function isInsideFunctionCall(string, index) {
  const result = { is: false, fn: null };
  const before = string.substring(0, index).trim();
  const after = string.substring(index + 1).trim();
  const beforeMatch = before.match(
    /(?:[a-zA-Z_-][\w-]*\()?(:?[a-zA-Z_-][\w-]*)\(/
  );

  if (beforeMatch && beforeMatch[0] && after.search(/^[^(]+\)/g) !== -1) {
    result.is = true;
    result.fn = beforeMatch[1];
  }

  return result;
}
Checks if the character is inside a function arguments

@param {String} string - the input string
@param {Number} index - current character index
@return {Object} return
   {Boolean} return.is - if inside a function arguments
   {String} return.fn - function name