mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-10 10:55:33 +00:00
Merge pull request #13800 from keymanapp/change/web/lint-kmwstring
change(web): lint kmwstring web-utility 🧶
This commit is contained in:
commit
b02f1d18bc
2 changed files with 3 additions and 7 deletions
|
|
@ -1,4 +0,0 @@
|
|||
module.exports = {
|
||||
// Temporarily ignored due to noise it would cause within the refactor
|
||||
ignorePatterns: ["**/kmwstring.ts"]
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue