src/7.ts   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 22
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
mnd 1
bc 1
fnc 0
dl 0
loc 22
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 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 {prepare} = creator8(opts)
8
9
  return async(root, result) => {
10
    const {RootExit, RuleExit} = prepare(result as typeof result & {root: typeof root})
11
12
    if (!(RootExit && RuleExit))
13
      return
14
15
    root.walkRules(RuleExit)
16
17
    await RootExit(root)
18
19
    return
20
  }
21
})
22
23