Hey,
in 0.9.x, it seems that the level "warn" was changed to "warning".
Whenever i try to process the validation levels with a switch like so, it throws a ts-error:
const parser = new DOMParser({
onError: (level, msg, context) => {
switch (level) {
case 'warning':
...
break
case 'error':
...
break
case 'fatalError':
...
break
default:
break
}
},
})
The error reads:
Type '"warning"' is not comparable to type '"warn" | "error" | "fatalError"'.ts(2678)
Workaround:
use // @ts-expect-error
The old one ("warn") does NOT throw a ts-error.
I'm assuming that somewhere you are still using "warn" instead of "warning" in your code?
Maybe here?:
|
* {'warn' | 'error' | 'fatalError'} |
xmldom version: 0.9.3
typescript version: 5.6.2
If you need further information, im happy to help!
Hey,
in 0.9.x, it seems that the level "warn" was changed to "warning".
Whenever i try to process the validation levels with a switch like so, it throws a ts-error:
The error reads:
Type '"warning"' is not comparable to type '"warn" | "error" | "fatalError"'.ts(2678)Workaround:
use
// @ts-expect-errorThe old one ("warn") does NOT throw a ts-error.
I'm assuming that somewhere you are still using "warn" instead of "warning" in your code?
Maybe here?:
xmldom/test/get-test-parser.js
Line 5 in 8279d83
xmldom version: 0.9.3
typescript version: 5.6.2
If you need further information, im happy to help!