UNPKG
@the-little-books/little
Version:
latest (0.2.8)
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
@the-little-books/little
/
src
/
ut
/
aline.ts
13 lines
(12 loc)
•
271 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
export
function
aline
(
text
:
string
):
string
{
return
( text .
split
(
"\n"
) .
map
(
(
s
) =>
s.
trimStart
())
// NOTE ignore non | lines
.
filter
(
(
s
) =>
s.
startsWith
(
"|"
)) .
map
(
(
s
) =>
s.
slice
(
1
)) .
map
(
(
s
) =>
s +
"\n"
) .
join
(
""
) ) }