Open
Description
It would be very practical, if parse would throw an error if it was not successful in parsing a color.
try {
const color = culori.parse('something');
console.log({color}); // {{ color: undefined }}
} catch (error) {
console.error(error);
}
The only way I can do this now is check for undefined
.
I'd find it very practical to get something like:
throw new Error(
`parse() must be an object or a valid color string but \`${arguments}\` were given.`
);