Remove unnecessary escape characters

This commit is contained in:
Devin Spikowski 2018-05-14 04:30:57 -04:00 committed by GitHub
parent 5ee55a7dc1
commit a3f5260e55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)