1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-10-02 08:06:42 +02:00

worker index basic support export/import

This commit is contained in:
Thomas Wilkerling
2025-03-20 09:42:26 +01:00
parent b0311432fd
commit b2c79cfd0e
45 changed files with 3059 additions and 2281 deletions

View File

@@ -1,6 +1,7 @@
import { IndexOptions } from "./type.js";
import { create_object, is_function, is_object, is_string } from "./common.js";
import handler from "./worker/handler.js";
import apply_async from "./async.js";
let pid = 0;
@@ -90,10 +91,16 @@ register("append");
register("search");
register("update");
register("remove");
register("clear");
register("export");
register("import");
apply_async(WorkerIndex.prototype);
function register(key) {
WorkerIndex.prototype[key] = WorkerIndex.prototype[key + "Async"] = async function () {
WorkerIndex.prototype[key] =
/*WorkerIndex.prototype[key + "Async"] =*/async function () {
const self = this,
args = [].slice.call(arguments),
arg = args[args.length - 1];