(declaration *Node)
| 2955 | } |
| 2956 | |
| 2957 | func GetDeclarationName(declaration *Node) string { |
| 2958 | name := GetNonAssignedNameOfDeclaration(declaration) |
| 2959 | if name != nil { |
| 2960 | if IsComputedPropertyName(name) { |
| 2961 | if IsStringOrNumericLiteralLike(name.Expression()) { |
| 2962 | return name.Expression().Text() |
| 2963 | } |
| 2964 | if IsPropertyAccessExpression(name.Expression()) { |
| 2965 | return name.Expression().Name().Text() |
| 2966 | } |
| 2967 | } else if IsPropertyName(name) { |
| 2968 | return name.Text() |
| 2969 | } |
| 2970 | } |
| 2971 | return "" |
| 2972 | } |
| 2973 | |
| 2974 | type SourceFileLike interface { |
| 2975 | Text() string |
no test coverage detected