util-ex
Version:
Browser-friendly enhanced util fully compatible with standard node.js
13 lines (12 loc) • 464 B
TypeScript
/**
* Determines if a string is a valid JavaScript identifier.
*
* @param {string} str - The string to check.
* @param {object} [options] - The options for checking.
* @param {boolean} [options.allowAsync=false] - Whether to support 'async ' prefix.
* @returns {boolean} - True if the string is a valid identifier, false otherwise.
*/
export function isIdentifier(str: string, options?: {
allowAsync?: boolean;
}): boolean;
export default isIdentifier;