Closed GodOfGrandeur closed 2 years ago
parse('abc');
Throws error
TypeError: Cannot read property 'slice' of null at parse (node_modules/iso8601-duration/lib/index.js:35:10)
Shouldn't throw a type error.
Could for instance add check that throws specific error when durationString doesn't match anything.
durationString
https://github.com/tolu/ISO8601-duration/blob/5cb2238944c95d6fb0ef9acc3dc15ff1edcd3029/src/index.js#L30
@tolu I was just encountering this. Maybe nullcheck and throw something specific or return a 0 duration.
Steps To Reproduce
parse('abc');
The current behavior
Throws error
The expected behavior
Shouldn't throw a type error.