@jiminp/tooltool
    Preparing search index...

    Function dedent

    • Trims leading/trailing blank lines and removes the common leading indentation from each line.

      Computes the minimum indentation across all non-empty lines, then strips that many leading whitespace characters from every line. Useful for cleaning up indented template literals.

      Parameters

      • text: string

        The text to dedent.

      Returns string

      The trimmed and dedented text.

      Empty lines (whitespace-only) do not contribute to the common indent calculation and become empty strings in the output. Mixed tabs and spaces are treated as individual characters; no tab-width expansion is performed.

      dedent(`
      Hello,
      world!
      `); // "Hello,\n world!"