GetExternalModuleName returns the module name from a module specifier expression.
(specifier *ast.Expression)
| 297 | |
| 298 | // GetExternalModuleName returns the module name from a module specifier expression. |
| 299 | func GetExternalModuleName(specifier *ast.Expression) string { |
| 300 | if specifier != nil && ast.IsStringLiteralLike(specifier.AsNode()) { |
| 301 | return specifier.Text() |
| 302 | } |
| 303 | return "" |
| 304 | } |
| 305 | |
| 306 | // CompareModuleSpecifiers compares two module specifiers using the given comparer. |
| 307 | func CompareModuleSpecifiers(m1 *ast.Expression, m2 *ast.Expression, comparer func(a, b string) int) int { |
no test coverage detected