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-flVYNk0f.cjs
8 lines
(7 loc)
•
242 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
"use strict"
;
const
regex =
require
(
"./regex.cjs"
);
const
split
= (
input, keepEmptyLines =
false
) => {
const
split2 = input.
split
(regex.
NEWLINE
);
return
keepEmptyLines ? split2 : split2.
filter
(
(
line
) =>
!!line); };
exports
.
split
= split;