Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 26 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import type { Options } from './options.types' |
||
2 | import postcss = require("postcss") |
||
3 | import creator8 = require(".") |
||
4 | import schema = require("./schema.json") |
||
5 | |||
6 | export = postcss.plugin<Options>(schema.title, opts => { |
||
7 | const { |
||
8 | prepare |
||
9 | } = creator8(opts) |
||
10 | |||
11 | return async (root, result) => { |
||
12 | const { |
||
13 | RootExit, RuleExit |
||
14 | } = prepare(result as typeof result & {root: typeof root}) |
||
15 | |||
16 | if (!(RootExit && RuleExit)) |
||
17 | return |
||
18 | |||
19 | root.walkRules(RuleExit) |
||
20 | |||
21 | await RootExit(root) |
||
22 | |||
23 | return |
||
24 | } |
||
25 | }) |
||
26 | |||
27 |