UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

29 lines (28 loc) 769 B
/** * Prefixes each line in the given string with the given prefix. * @example * ```ts * const text = `Line 1 * Line 2 * Line 3`; * const prefixed = prefixLines(text, '> '); * console.log(prefixed); * ``` * This will output: * ```md * > Line 1 * > Line 2 * > Line 3 * ``` */ export declare function prefixLines(line: string, prefix: string): string; /** * Joins the given elements using the given join string, but uses a different string for the last join. * @example * ```ts * const items = ['apple', 'banana', 'cherry']; * const result = lastJoin(items, ', ', ' and '); * console.log(result); // Output: "apple, banana and cherry" * ``` */ export declare function lastJoin(elements: readonly string[], join: string, lastjoin: string): string;