(
key: string,
type: 'src' | 'srcset',
filter?: (data: HtmlAssetSourceFilterData) => boolean,
)
| 150 | |
| 151 | const actions: HtmlAssetAttribute[] = [] |
| 152 | function handleAttributeKey( |
| 153 | key: string, |
| 154 | type: 'src' | 'srcset', |
| 155 | filter?: (data: HtmlAssetSourceFilterData) => boolean, |
| 156 | ) { |
| 157 | const value = attributes[key] |
| 158 | if (!value) return |
| 159 | if (filter && !filter({ key, value, attributes })) return |
| 160 | const location = node.sourceCodeLocation!.attrs![key] |
| 161 | actions.push({ type, key, value, attributes, location }) |
| 162 | } |
| 163 | |
| 164 | // Run matching for default asset sources |
| 165 | if (defaults) { |
no test coverage detected