Passed
Push — master ( 9680fc...eb4eeb )
by Andrii
02:45
created

src/7.ts   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 26
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 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