Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace utils

Index

Functions

isEmpty

  • isEmpty(doc: Doc): boolean
  • Parameters

    Returns boolean

isLineNext

  • isLineNext(doc: Doc): boolean
  • Parameters

    Returns boolean

mapDoc

  • mapDoc<T>(doc: Doc, callback: (doc: Doc) => T): T
  • Type parameters

    • T

    Parameters

    • doc: Doc
    • callback: (doc: Doc) => T
        • (doc: Doc): T
        • Parameters

          Returns T

    Returns T

propagateBreaks

  • propagateBreaks(doc: Doc): void
  • Parameters

    Returns void

removeLines

  • Parameters

    Returns Doc

stripTrailingHardline

  • stripTrailingHardline(doc: Doc): Doc
  • Parameters

    Returns Doc

traverseDoc

  • traverseDoc(doc: Doc, onEnter?: undefined | ((doc: Doc) => void | boolean), onExit?: undefined | ((doc: Doc) => void), shouldTraverseConditionalGroups?: undefined | false | true): void
  • Parameters

    • doc: Doc
    • Optional onEnter: undefined | ((doc: Doc) => void | boolean)
    • Optional onExit: undefined | ((doc: Doc) => void)
    • Optional shouldTraverseConditionalGroups: undefined | false | true

    Returns void

willBreak

  • willBreak(doc: Doc): boolean
  • Parameters

    Returns boolean