-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.d.ts
More file actions
26 lines (20 loc) · 613 Bytes
/
Copy pathindex.d.ts
File metadata and controls
26 lines (20 loc) · 613 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export interface Options {
/**
Preserve the line separator at the end of every line, except the last line, which will never contain one.
@default false
*/
readonly preserveNewlines?: boolean;
}
/**
Split lines into an array of lines.
@param string - String to split.
@example
```
import splitLines from 'split-lines';
splitLines('foo\r\nbar\r\nbaz\nrainbow');
//=> ['foo', 'bar', 'baz', 'rainbow']
splitLines('foo\r\nbar\r\nbaz\nrainbow', {preserveNewlines: true});
//=> ['foo\r\n', 'bar\r\n', 'baz\n', 'rainbow']
```
*/
export default function splitLines(string: string, options?: Options): string[];