(pattern: string | RegExp, importee: string)
| 105 | |
| 106 | // In sync with rollup plugin alias logic |
| 107 | function matches(pattern: string | RegExp, importee: string) { |
| 108 | if (pattern instanceof RegExp) { |
| 109 | return pattern.test(importee) |
| 110 | } |
| 111 | if (importee.length < pattern.length) { |
| 112 | return false |
| 113 | } |
| 114 | if (importee === pattern) { |
| 115 | return true |
| 116 | } |
| 117 | return importee.startsWith(withTrailingSlash(pattern)) |
| 118 | } |
| 119 | |
| 120 | function getAliasPatterns( |
| 121 | entries: (AliasOptions | undefined) & Alias[], |
no test coverage detected