Function isValidPropertyAccess

  • Determines whether the given text can be used to access a property with a PropertyAccessExpression while preserving the property's name.

    Parameters

    • text: string
    • languageVersion: ScriptTarget = ts.ScriptTarget.Latest

    Returns boolean

    Example

    isValidPropertyAccess("abc"); // true
    isValidPropertyAccess("123"); // false