Merge pull request #13800 from keymanapp/change/web/lint-kmwstring

change(web): lint kmwstring web-utility 🧶
This commit is contained in:
Joshua Horton 2025-05-06 08:16:56 +07:00 committed by GitHub
commit b02f1d18bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View file

@ -1,4 +0,0 @@
module.exports = {
// Temporarily ignored due to noise it would cause within the refactor
ignorePatterns: ["**/kmwstring.ts"]
};

View file

@ -55,9 +55,9 @@ export function charCodeAt(s: string, index: number) {
}
}
let first = str.charCodeAt(codeUnitIndex);
const first = str.charCodeAt(codeUnitIndex);
if(first >= 0xD800 && first <= 0xDBFF && str.length > codeUnitIndex + 1) {
let second = str.charCodeAt(codeUnitIndex + 1);
const second = str.charCodeAt(codeUnitIndex + 1);
if(second >= 0xDC00 && second <= 0xDFFF) {
return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000;
}
@ -248,7 +248,7 @@ export function substring(s: string, indexA: number, indexB?: number) {
indexBCodeUnit = str.length;
} else {
if(indexA > indexB) {
let c = indexA;
const c = indexA;
indexA = indexB;
indexB = c;
}