Added error checking for when an invalid string is input.

This commit is contained in:
Ashton Cummings 2018-09-20 09:26:31 -05:00
parent 9797b474af
commit e0be5577a7

View File

@ -63,6 +63,8 @@ function parseTimestring (string, returnUnit, opts) {
totalSeconds += getSeconds(value, unit, unitValues) totalSeconds += getSeconds(value, unit, unitValues)
}) })
} else {
throw new Error(`The string [${string}] is invalid for timestring`)
} }
if (returnUnit) { if (returnUnit) {