10 * @param {stringdex.Hooks} hooks
11 */
12▶const initSearch = async function(Stringdex, RoaringBitmap, hooks) {
13
14// polyfill
· · ·
15// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced
16if (!Array.prototype.toSpliced) {
17▶ // Can't use arrow functions, because we want `this`
18 Array.prototype.toSpliced = function() {
19 const me = this.slice();
· · ·
18▶ Array.prototype.toSpliced = function() {
19 const me = this.slice();
20 // @ts-expect-error
· · ·
28 * @template T
29 * @param {Iterable<T>} arr
30▶ * @param {function(T): Promise<any>} func
31 * @param {function(T): void} funcBtwn
32 */
· · ·
31▶ * @param {function(T): void} funcBtwn
32 */
33async function onEachBtwnAsync(arr, func, funcBtwn) {
+ 277 more matches in this file
7const CHANNEL_REGEX = new RegExp("/nightly/|/beta/|/stable/|/1\\.[0-9]+\\.[0-9]+/");
8
9▶function arrayToCode(array) {
10 return array.map((value, index) => {
11 value = value.split(" ").join(" ");
· · ·
14}
15
16▶function loadContent(content) {
17 const Module = module.constructor;
18 const m = new Module();
· · ·
27}
28
29▶function readFile(filePath) {
30 return fs.readFileSync(filePath, "utf8");
31}
· · ·
32
33▶function contentToDiffLine(key, value) {
34 if (typeof value === "object" && !Array.isArray(value) && value !== null) {
35 const out = Object.entries(value)
· · ·
42}
43
44▶function shouldIgnoreField(fieldName) {
45 return fieldName === "query" || fieldName === "correction" ||
46 fieldName === "proposeCorrectionFrom" ||
+ 24 more matches in this file
5"use strict";
6
7▶// The amount of time that the cursor must remain still over a hover target before
8// revealing a tooltip.
9//
· · ·
19 * @param {string} extension
20 */
21▶function resourcePath(basename, extension) {
22 return getVar("root-path") + basename + getVar("resource-suffix") + extension;
23}
· · ·
24
25▶function hideMain() {
26 addClass(document.getElementById(MAIN_ID), "hidden");
27 const toggle = document.getElementById("toggle-all-docs");
· · ·
26▶ addClass(document.getElementById(MAIN_ID), "hidden");
27 const toggle = document.getElementById("toggle-all-docs");
28 if (toggle) {
· · ·
31}
32
33▶function showMain() {
34 const main = document.getElementById(MAIN_ID);
35 if (!main) {
+ 111 more matches in this file
13const builtinThemes = ["light", "dark", "ayu"];
14const darkThemes = ["dark", "ayu"];
15▶window.currentTheme = (function() {
16 const currentTheme = document.getElementById("themeStyle");
17 return currentTheme instanceof HTMLLinkElement ? currentTheme : null;
· · ·
18})();
19
20▶const settingsDataset = (function() {
21 const settingsElement = document.getElementById("default-settings");
22 return settingsElement && settingsElement.dataset ? settingsElement.dataset : null;
· · ·
37// used in other files, not yet used in this one.
38// eslint-disable-next-line no-unused-vars
39▶function nonnull(x, msg) {
40 if (x === null) {
41 throw (msg || "unexpected null value!");
· · ·
59// used in other files, not yet used in this one.
60// eslint-disable-next-line no-unused-vars
61▶function nonundef(x, msg) {
62 if (x === undefined) {
63 throw (msg || "unexpected null value!");
· · ·
73 * @returns
74 */
75▶function getSettingValue(settingName) {
76 const current = getCurrentValue(settingName);
77 if (current === null && settingsDataset !== null) {
+ 25 more matches in this file
294 }
295 /**
296▶ * Helper function used when constructing bitmaps from lists.
297 * Returns an array container with at least two free byte slots
298 * and bumps `this.cardinalities`.
· · ·
1036 * @returns {number}
1037 */
1038▶function bitCount(n) {
1039 n = (~~n) - ((n >> 1) & 0x55555555);
1040 n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
· · ·
1087 * @returns {Promise<stringdex.Database>}
1088 */
1089▶function loadDatabase(hooks) {
1090 /** @type {stringdex.Callbacks} */
1091 const callbacks = {
· · ·
1092▶ rr_: function(data) {
1093 const dataObj = JSON.parse(data);
1094 for (const colName of Object.keys(dataObj)) {
· · ·
1126 }
1127 },
1128▶ err_rr_: function(err) {
1129 const cb = registry.searchTreeRootCallback;
1130 if (cb) {
+ 28 more matches in this file
2/* global getSettingValue, updateLocalStorage, updateTheme */
3/* global addClass, removeClass, onEach, onEachLazy */
4▶/* global MAIN_ID, getVar, nonnull */
5
6"use strict";
· · ·
7
8▶(function() {
9 const isSettingsPage = window.location.pathname.endsWith("/settings.html");
10
· · ·
17 * @param {string|boolean} value
18 */
19▶ function changeSetting(settingName, value) {
20 if (settingName === "theme") {
21 const useSystem = value === "system preference" ? "true" : "false";
· · ·
58 }
59
60▶ function showLightAndDark() {
61 removeClass(document.getElementById("preferred-light-theme"), "hidden");
62 removeClass(document.getElementById("preferred-dark-theme"), "hidden");
· · ·
63 }
64
65▶ function hideLightAndDark() {
66 addClass(document.getElementById("preferred-light-theme"), "hidden");
67 addClass(document.getElementById("preferred-dark-theme"), "hidden");
+ 11 more matches in this file
16const wasmBuffer = fs.readFileSync(wasmfile);
17
18▶async function main() {
19
20 let memory = new ArrayBuffer(0) // will be changed after instantiate
· · ·
57}
58
59▶function assert_equal(captured_output, expected_output) {
60 if (captured_output.length != expected_output.length) {
61 console.error("Unexpected number of output lines. Got", captured_output.length, "but expected", expected_output.length);
· · ·