(opts: ProcessPatternOpts)
| 98 | } |
| 99 | |
| 100 | const processPattern = (opts: ProcessPatternOpts): ComponentReportItem | undefined => { |
| 101 | const { boxNode, data, item, filepath, localMaps } = opts |
| 102 | const name = item.componentName |
| 103 | const pattern = ctx.patterns.details.find((p) => p.match.test(name) || p.baseName === name) |
| 104 | if (!pattern) return |
| 105 | const cssObj = pattern.config.transform?.(data || {}, patternFns) ?? {} |
| 106 | const newItem: ResultItem = { |
| 107 | name: 'css', |
| 108 | type: 'css', |
| 109 | box: box.objectToMap(compact(cssObj), boxNode.getNode(), boxNode.getStack()), |
| 110 | data: [cssObj], |
| 111 | } |
| 112 | Object.assign(newItem, { debug: true }) |
| 113 | return processResultItem({ item: newItem, kind: 'function', localMaps, filepath }) |
| 114 | } |
| 115 | |
| 116 | const processResultItem = (opts: ProcessResultItemOpts) => { |
| 117 | const { item, kind, filepath, localMaps } = opts |
no test coverage detected