@sap-cloud-sdk/util
Version:
SAP Cloud SDK for JavaScript general utilities
13 lines (12 loc) • 703 B
TypeScript
/**
* @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;`
* ```
* @param strings - Strings in the tagged template. In the example above that would be ['Code with ', ' and more code;'].
* @param args - Arguments in the tagged template. In the example above that would be the resolved value for `arguments`;.
* @returns A string formatted as code block.
*/
export declare function codeBlock(strings: TemplateStringsArray, ...args: any[]): string;