UNPKG

util-ex

Version:

Browser-friendly enhanced util fully compatible with standard node.js

12 lines (11 loc) 508 B
/** * Determines if a string represents a valid JavaScript arrow function. * @param {string} aFuncString - The string to test. * @returns {boolean} - True if the string represents a valid arrow function, false otherwise. * @example * isArrowFunctionStr('(x, y) => x + y') // true * isArrowFunctionStr('async x => { return x; }') // true * isArrowFunctionStr('function(x) { return x; }') // false */ export function isArrowFunctionStr(aFuncString: string): boolean; export default isArrowFunctionStr;