( importNode: AstNode, importedAst: AstNode[], layer: string | null, media: string | null, supports: string | null, )
| 148 | } |
| 149 | |
| 150 | function buildImportNodes( |
| 151 | importNode: AstNode, |
| 152 | importedAst: AstNode[], |
| 153 | layer: string | null, |
| 154 | media: string | null, |
| 155 | supports: string | null, |
| 156 | ): AstNode[] { |
| 157 | let root = importedAst |
| 158 | |
| 159 | if (layer !== null) { |
| 160 | let node = atRule('@layer', layer, root) |
| 161 | node.src = importNode.src |
| 162 | root = [node] |
| 163 | } |
| 164 | |
| 165 | if (media !== null) { |
| 166 | let node = atRule('@media', media, root) |
| 167 | node.src = importNode.src |
| 168 | root = [node] |
| 169 | } |
| 170 | |
| 171 | if (supports !== null) { |
| 172 | let node = atRule('@supports', supports[0] === '(' ? supports : `(${supports})`, root) |
| 173 | node.src = importNode.src |
| 174 | root = [node] |
| 175 | } |
| 176 | |
| 177 | return root |
| 178 | } |
no test coverage detected