@augment-vir/common
Version:
A collection of augments, helpers types, functions, and classes for any JavaScript environment.
33 lines (32 loc) • 895 B
TypeScript
/**
* Trim all lines within a string and keep it a string.
*
* @category String
* @category Package : @augment-vir/common
* @example
*
* ```ts
* import {trimLines} from '@augment-vir/common';
*
* const result = trimLines(' hi \n bye \n\n abc'); // 'hi\nbye\nabc'
* ```
*
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export declare function trimLines(value: string): string;
/**
* Split a string by newline and trim each line.
*
* @category String
* @category Package : @augment-vir/common
* @example
*
* ```ts
* import {trimLines} from '@augment-vir/common';
*
* const result = trimAndSplitLines(' hi \n bye \n\n abc'); // ['hi', 'bye', 'abc']
* ```
*
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export declare function trimAndSplitLines(value: string): string[];