HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall_forms/buyercall/node_modules/trim-newlines/index.d.ts
// Source: https://github.com/sindresorhus/type-fest/blob/main/source/internal.d.ts#L49
type Newline =
	| '\u{A}' // '\n'
	| '\u{D}' // '\r'
	;

// Source: https://github.com/sindresorhus/type-fest/blob/main/source/trim.d.ts
type TrimStart<S extends string> = S extends `${Newline}${infer R}` ? TrimStart<R> : S;

type TrimEnd<S extends string> = S extends `${infer R}${Newline}` ? TrimEnd<R> : S;

export type Trim<S extends string> = TrimStart<TrimEnd<S>>;

/**
Trim from the start and end of a string.

@example
```js
import {trimNewlines} from 'trim-newlines';

trimNewlines('\nšŸ¦„\nšŸ¦„\r\n');
//=> 'šŸ¦„\nšŸ¦„'
```
*/
export function trimNewlines<S extends string>(string: S): Trim<S>;

/**
Trim from the start of a string.

@example
```js
import {trimNewlinesStart} from 'trim-newlines';

trimNewlinesStart('\nšŸ¦„\r\n');
//=> 'šŸ¦„\r\n'
```
*/
export function trimNewlinesStart<S extends string>(string: S): TrimStart<S>;

/**
Trim from the end of a string.

@example
```js
import {trimNewlinesEnd} from 'trim-newlines';

trimNewlinesEnd('\nšŸ¦„\r\n');
//=> '\nšŸ¦„'
```
*/
export function trimNewlinesEnd<S extends string>(string: S): TrimEnd<S>;