Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function findUnicodeRangeIndex(cp, ranges) {
let lo = 0
, hi = ranges.length - 1;
while (lo <= hi) {
let mid = lo + hi >>> 1
const mid = lo + hi >>> 1
, range = ranges[mid];
if (cp < range[0]) hi = mid - 1;
else if (cp > range[1]) lo = mid + 1;
Expand Down
8 changes: 4 additions & 4 deletions src/grapheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function* graphemeSegments(input) {
let cursor = 0;

/** @type {number} Total length of the input string. */
let len = input.length;
const len = input.length;

/** @type {GraphemeCategoryNum | null} Category of codepoint immediately preceding cursor, if known. */
let catBefore = null;
Expand All @@ -64,7 +64,7 @@ export function* graphemeSegments(input) {
let catBegin = null;

/** @type {import('./_grapheme_data.js').GraphemeCategoryRange} */
let cache = [0, 0, 2 /* GC_Control */];
const cache = [0, 0, 2 /* GC_Control */];

/** @type {number} The number of RIS codepoints preceding `cursor`. */
let risCount = 0;
Expand Down Expand Up @@ -232,11 +232,11 @@ function cat(cp, cache) {
// If this char isn't within the cached range, update the cache to the
// range that includes it.
if (cp < cache[0] || cp > cache[1]) {
let index = findUnicodeRangeIndex(cp, grapheme_ranges);
const index = findUnicodeRangeIndex(cp, grapheme_ranges);
if (index < 0) {
return 0;
}
let range = grapheme_ranges[index];
const range = grapheme_ranges[index];
cache[0] = range[0];
cache[1] = range[1];
cache[2] = range[2];
Expand Down