util-ex
Version:
Browser-friendly enhanced util fully compatible with standard node.js
11 lines (10 loc) • 426 B
TypeScript
/**
* Determines if a string represents a valid JavaScript function.
* @param {string} aFuncString - The string to test.
* @returns {boolean} - True if the string represents a valid function, false otherwise.
* @example
* isFunctionStr('function add(x, y) { return x + y; }') // true
* isFunctionStr('const x = 5;') // false
*/
export function isFunctionStr(aFuncString: string): boolean;
export default isFunctionStr;