• Experimental

    This API is experimental and might change in newer versions. Use with caution. Transform strings and arguments to a string formatted as a code block, keeping the indentation of sub code blocks. Use in tagged templates, e.g.:

    codeBlock`Code with ${arguments} and more code;`
    

    Parameters

    • strings: TemplateStringsArray

      Strings in the tagged template. In the example above that would be ['Code with ', ' and more code;'].

    • Rest...args: any[]

      Arguments in the tagged template. In the example above that would be the resolved value for arguments;.

    Returns string

    A string formatted as code block.

    Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.