(pathname string)
| 1368 | } |
| 1369 | |
| 1370 | func normalizeSavePath(pathname string) string { |
| 1371 | if strings.HasPrefix(pathname, "modules/transform/") || strings.HasPrefix(pathname, "modules/x/") { |
| 1372 | return pathname |
| 1373 | } |
| 1374 | segments := strings.Split(pathname, "/") |
| 1375 | for i, seg := range segments { |
| 1376 | if strings.HasPrefix(seg, "X-") && len(seg) > 42 { |
| 1377 | h := sha1.New() |
| 1378 | h.Write([]byte(seg)) |
| 1379 | segments[i] = "x-" + hex.EncodeToString(h.Sum(nil)) |
| 1380 | } else if strings.HasPrefix(seg, "*") { |
| 1381 | segments[i] = seg[1:] + "/ea" |
| 1382 | } |
| 1383 | } |
| 1384 | return strings.Join(segments, "/") |
| 1385 | } |
| 1386 | |
| 1387 | // normalizeImportSpecifier normalizes the given specifier. |
| 1388 | func normalizeImportSpecifier(specifier string) string { |
no test coverage detected