UNPKG
vbb-disruptions
Version:
latest (0.3.1)
0.3.1
0.2.0
0.1.0
Disruptions in VBB public transport.
github.com/derhuerst/vbb-disruptions
derhuerst/vbb-disruptions
vbb-disruptions
/
helpers.js
15 lines
(10 loc)
•
264 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict'
const
trim =
/^[\s\r\n]+|[\r\n\s]+$/g
const
newline =
/\s*[\r\n]+\s*/g
const
clean
= (
str
) => str.
replace
(trim,
''
).
replace
(newline,
'\n'
)
const
line
= (
str
) => { str = str.
split
(
' '
)
return
str[str.
length
-
1
] }
module
.
exports
= {clean, line}