I have an SVG that uses classes and was failing with an error:
svg-to-pdfkit.js:612 Uncaught TypeError: elem.classList.indexOf is not a function
Description
elem.classList returns a DOMTokenList (see Element.classList).
DOMTokenList doesn't have an indexOf method which was causing this check to error.
However it does have a contains method, which this PR uses to do an equivalent check.
Background
I have an SVG that uses classes and was failing with an error:
svg-to-pdfkit.js:612 Uncaught TypeError: elem.classList.indexOf is not a function
Description
elem.classList
returns a DOMTokenList (see Element.classList). DOMTokenList doesn't have anindexOf
method which was causing this check to error. However it does have acontains
method, which this PR uses to do an equivalent check.