Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "normalize"

Index

Variables

Const isArray

isArray: <T>(arg: {} | T) => arg is T extends readonly any[] ? unknown extends T ? never : readonly any[] : any[] = isa

Type declaration

    • <T>(arg: {} | T): arg is T extends readonly any[] ? unknown extends T ? never : readonly any[] : any[]
    • Type parameters

      • T

      Parameters

      • arg: {} | T

      Returns arg is T extends readonly any[] ? unknown extends T ? never : readonly any[] : any[]

Const isNotStringAndIterable

isNotStringAndIterable: (x: any) => x is Iterable<any> = isi

Type declaration

    • (x: any): x is Iterable<any>
    • Parameters

      • x: any

      Returns x is Iterable<any>

Const isPlainObject

isPlainObject: (x: any) => x is Record<string, any> = iso

Type declaration

    • (x: any): x is Record<string, any>
    • Parameters

      • x: any

      Returns x is Record<string, any>

Functions

Const _normalizeTree

  • _normalizeTree(tree: any, opts: Partial<HDOMOpts>, ctx: any, path: number[], keys: boolean, span: boolean): any

Const normalizeChildren

  • normalizeChildren(norm: any[], nattribs: any, opts: Partial<HDOMOpts>, ctx: any, path: number[], keys: boolean, span: boolean): any[]

Const normalizeElement

  • normalizeElement(spec: any[], keys: boolean): any[]
  • Expands single hiccup element/component into its canonical form:

    [tagname, {attribs}, ...children]

    Emmet-style ID and class names in the original tagname are moved into the attribs object, e.g.:

    ["div#foo.bar.baz"] => ["div", {id: "foo", class: "bar baz"}]

    If both Emmet-style classes AND a class attrib exists, the former are appended to the latter:

    ["div.bar.baz", {class: "foo"}] => ["div", {class: "foo bar baz"}]

    Elements with __skip attrib enabled and no children, will have an empty text child element injected.

    internal

    Parameters

    • spec: any[]

      single hdom component

    • keys: boolean

      -

    Returns any[]

Const normalizeTree

  • normalizeTree(opts: Partial<HDOMOpts>, tree: any): any

Generated using TypeDoc