This is an automated email from the ASF dual-hosted git repository. randall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 9eb97746989c9f08cacdf76a36d3e6b2208f9c41 Author: Randall Leeds <[email protected]> AuthorDate: Sat Sep 19 18:38:25 2020 -0700 Autofix lint --- packages/dom/src/text-quote/describe.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/dom/src/text-quote/describe.ts b/packages/dom/src/text-quote/describe.ts index 0103cab..e6275b5 100644 --- a/packages/dom/src/text-quote/describe.ts +++ b/packages/dom/src/text-quote/describe.ts @@ -76,18 +76,28 @@ function calculateContextForDisambiguation( // Count how many characters we’d need as a prefix to disqualify this match. let sufficientPrefixLength = prefix.length + 1; - const firstChar = (offset: number) => scopeText[offset - sufficientPrefixLength]; - while (firstChar(targetStartIndex) && firstChar(targetStartIndex) === firstChar(matchStartIndex)) + const firstChar = (offset: number) => + scopeText[offset - sufficientPrefixLength]; + while ( + firstChar(targetStartIndex) && + firstChar(targetStartIndex) === firstChar(matchStartIndex) + ) sufficientPrefixLength++; - if (!firstChar(targetStartIndex)) // We reached the start of scopeText; prefix won’t work. + if (!firstChar(targetStartIndex)) + // We reached the start of scopeText; prefix won’t work. sufficientPrefixLength = Infinity; // Count how many characters we’d need as a suffix to disqualify this match. let sufficientSuffixLength = suffix.length + 1; - const lastChar = (offset: number) => scopeText[offset + sufficientSuffixLength - 1]; - while (lastChar(targetEndIndex) && lastChar(targetEndIndex) === lastChar(matchEndIndex)) + const lastChar = (offset: number) => + scopeText[offset + sufficientSuffixLength - 1]; + while ( + lastChar(targetEndIndex) && + lastChar(targetEndIndex) === lastChar(matchEndIndex) + ) sufficientSuffixLength++; - if (!lastChar(targetEndIndex)) // We reached the end of scopeText; suffix won’t work. + if (!lastChar(targetEndIndex)) + // We reached the end of scopeText; suffix won’t work. sufficientSuffixLength = Infinity; // Use either the prefix or suffix, whichever is shortest.
