( node: DefaultTreeAdapterMap['element'], )
| 1089 | // <tag style="... url(...) or image-set(...) ..."></tag> |
| 1090 | // extract inline styles as virtual css |
| 1091 | export function findNeedTransformStyleAttribute( |
| 1092 | node: DefaultTreeAdapterMap['element'], |
| 1093 | ): { attr: Token.Attribute; location?: Token.Location } | undefined { |
| 1094 | const attr = node.attrs.find( |
| 1095 | (prop) => |
| 1096 | prop.prefix === undefined && |
| 1097 | prop.name === 'style' && |
| 1098 | // only url(...) or image-set(...) in css need to emit file |
| 1099 | (prop.value.includes('url(') || prop.value.includes('image-set(')), |
| 1100 | ) |
| 1101 | if (!attr) return undefined |
| 1102 | const location = node.sourceCodeLocation?.attrs?.style |
| 1103 | return { attr, location } |
| 1104 | } |
| 1105 | |
| 1106 | export function extractImportExpressionFromClassicScript( |
| 1107 | scriptTextNode: DefaultTreeAdapterMap['textNode'], |
no outgoing calls
no test coverage detected