UNPKG
reserve-cmd
Version:
latest (1.0.4)
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
command handler for REserve
github.com/ArnaudBuchholz/reserve-cmd
ArnaudBuchholz/reserve-cmd
reserve-cmd
/
parseCmd.js
11 lines
(9 loc)
•
268 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'use strict'
module
.
exports
=
redirect
=>
{
const
result = []
const
add
= text => result.
push
(text.
replace
(
/``/g
,
'`'
)) redirect.
replace
(
/`((?:[^`]|``)+)`|([^ ](?:[^ ]|``)*)/g
,
(
match, escaped, raw
) =>
{
add
(escaped || raw) })
return
result }