Remove unnecessary escape characters
This commit is contained in:
parent
5ee55a7dc1
commit
a3f5260e55
4
index.js
4
index.js
@ -54,11 +54,11 @@ function parseTimestring (string, returnUnit, opts) {
|
|||||||
let groups = string
|
let groups = string
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/[^.\w+-]+/g, '')
|
.replace(/[^.\w+-]+/g, '')
|
||||||
.match(/[-+]?[0-9\.]+[a-z]+/g)
|
.match(/[-+]?[0-9.]+[a-z]+/g)
|
||||||
|
|
||||||
if (groups !== null) {
|
if (groups !== null) {
|
||||||
groups.forEach(group => {
|
groups.forEach(group => {
|
||||||
let value = group.match(/[0-9\.]+/g)[0]
|
let value = group.match(/[0-9.]+/g)[0]
|
||||||
let unit = group.match(/[a-z]+/g)[0]
|
let unit = group.match(/[a-z]+/g)[0]
|
||||||
|
|
||||||
totalSeconds += getSeconds(value, unit, unitValues)
|
totalSeconds += getSeconds(value, unit, unitValues)
|
||||||
|
Loading…
Reference in New Issue
Block a user