All files / skip / mod.ts

100.00% Branches 1/1
100.00% Lines 11/11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
x8
 
 
 
x8
x8
x8
x8
x29
x30
x30
x29
x8
 
 
x8














// Imports
import { type Directive, Phase } from "@mizu/internal/engine"
export type * from "@mizu/internal/engine"

/** `*skip` directive. */
export const _skip = {
  name: "*skip",
  phase: Phase.PREPROCESSING,
  setup(renderer, element) {
    if ((renderer.isHtmlElement(element)) && (element.hasAttribute(this.name))) {
      return false
    }
  },
} as Directive & { name: string }

/** Default exports. */
export default _skip