Fix broken search on pkldoc

This commit is contained in:
Dan Chao authored and Philip K.F. Hölzenspies committed 2024-02-06 11:23:23 +00:00
1 parent 90c60c700d
commit f0ae1be76a
2 files changed
+6 -6

No files matched your search

@@ -14,6 +14,7 @@ if (isWorker) {
const searchIndexUrl = workerName === "main" ?
'../search-index.js' :
'../' + workerName + '/search-index.js';
importScripts(searchIndexUrl);
initSearchIndex();
addEventListener('message', e => {
const {query, packageName, moduleName, className} = e.data;
@@ -177,12 +178,11 @@ function toWordStarts(characters) {
return result;
}
const regexIsUppercase = /\p{Lu}/u
const regexIsNumericCharacter = /\p{N}/u
// Partitions characters into uppercase, digit, dot, and other.
function toCharClass(ch) {
const regexIsUppercase = /\p{Lu}/u
const regexIsNumericCharacter = /\p{N}/u
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
}
@@ -14,6 +14,7 @@ if (isWorker) {
const searchIndexUrl = workerName === "main" ?
'../search-index.js' :
'../' + workerName + '/search-index.js';
importScripts(searchIndexUrl);
initSearchIndex();
addEventListener('message', e => {
const {query, packageName, moduleName, className} = e.data;
@@ -177,12 +178,11 @@ function toWordStarts(characters) {
return result;
}
const regexIsUppercase = /\p{Lu}/u
const regexIsNumericCharacter = /\p{N}/u
// Partitions characters into uppercase, digit, dot, and other.
function toCharClass(ch) {
const regexIsUppercase = /\p{Lu}/u
const regexIsNumericCharacter = /\p{N}/u
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
}