We have a Code QL bug reported in this library for js/incorrect-suffix-check
Error: Using indexOf to implement endsWith functionality is error-prone if the -1 case is not explicitly handled.
Severity: High and Important
FIle is under \roosterjs-editor-dom\lib-mjs\utils\getComputedStyles.js. Screenshot shows the function and line to add check.
Hello,
We have a Code QL bug reported in this library for js/incorrect-suffix-check Error: Using indexOf to implement endsWith functionality is error-prone if the -1 case is not explicitly handled. Severity: High and Important
FIle is under \roosterjs-editor-dom\lib-mjs\utils\getComputedStyles.js. Screenshot shows the function and line to add check.
Expected behavior Suggested fix: if (px && px.indexOf('px') !== -1 && px.indexOf('px') == px.length - 2) {
Screenshots
Device Information N/A
Additional context N/A
Please kindly address this issue as soon as possible. Thank you.