(path: string)
| 85 | } |
| 86 | |
| 87 | export function isMaskImagePath(path: string): boolean { |
| 88 | const segments = normalizeImagePath(path) |
| 89 | .split('/') |
| 90 | .filter(Boolean); |
| 91 | const firstMaskSegment = getSegmentIndex( |
| 92 | segments, |
| 93 | segment => segment.toLowerCase() === 'masks' |
| 94 | ); |
| 95 | |
| 96 | if (firstMaskSegment === -1) { |
| 97 | return false; |
| 98 | } |
| 99 | |
| 100 | const firstImageRootSegment = getSegmentIndex(segments, isCanonicalImageRootSegment); |
| 101 | return firstImageRootSegment === -1 || firstMaskSegment < firstImageRootSegment; |
| 102 | } |
| 103 | |
| 104 | export function getImagePathLookupSuffixes(path: string): string[] { |
| 105 | const suffixes = getPathSuffixes(path); |
no test coverage detected