UNPKG
@alexaegis/advent-of-code-lib
Version:
latest (1.0.1)
1.0.1
1.0.0
Advent of Code Library
github.com/AlexAegis
AlexAegis/advent-of-code
@alexaegis/advent-of-code-lib
/
split.function-IqLppBRO.js
9 lines
(8 loc)
•
224 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
{
NEWLINE
}
from
"./regex.js"
;
const
split
= (
input, keepEmptyLines =
false
) => {
const
split2 = input.
split
(
NEWLINE
);
return
keepEmptyLines ? split2 : split2.
filter
(
(
line
) =>
!!line); };
export
{ split
as
s };