From d67924960418f5e54b37b9f87e38341c560c5ee3 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 10 Oct 2024 21:55:08 +0200 Subject: [PATCH 1/6] ixx: init --- .gitignore | 2 + flake.nix | 10 +- package.json | 1 + pnpm-lock.yaml | 235 ++++++++++-------- public/fixx_bg.wasm | 1 + .../components/search/search.component.html | 2 +- .../components/search/search.component.ts | 22 +- src/app/core/data/search.service.ts | 116 ++++----- 8 files changed, 204 insertions(+), 185 deletions(-) create mode 120000 public/fixx_bg.wasm diff --git a/.gitignore b/.gitignore index 35f9eb9..30432be 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ Thumbs.db # CUSTOM result +/public/meta +/public/index.ixx diff --git a/flake.nix b/flake.nix index 69bcd36..5a1c0a3 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,19 @@ in { devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ + nativeBuildInputs = with pkgs; [ nodejs pnpm (python3.withPackages (ps: with ps; [ markdown pygments ])) + + cargo + clippy + rustc + rustc.llvmPackages.lld + wasm-pack ]; + + RUST_SRC_PATH = pkgs.rust.packages.stable.rustPlatform.rustLibSrc; }; packages = rec { diff --git a/package.json b/package.json index 357fcc9..fa3278a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@feel/style": "^0.0.25", "@fontsource/dm-mono": "^5.1.0", "@fontsource/dm-sans": "^5.1.0", + "@nuschtos/fixx": "link:../ixx/result", "rxjs": "~7.8.1", "tslib": "^2.7.0", "zone.js": "~0.15.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5d95cfa..2a10994 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,40 +10,43 @@ importers: dependencies: '@angular/animations': specifier: ^18.2.7 - version: 18.2.8(@angular/core@18.2.8) + version: 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@angular/common': specifier: ^18.2.7 - version: 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + version: 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/compiler': specifier: ^18.2.7 - version: 18.2.8(@angular/core@18.2.8) + version: 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@angular/core': specifier: ^18.2.7 version: 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) '@angular/forms': specifier: ^18.2.7 - version: 18.2.8(@angular/common@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8)(rxjs@7.8.1) + version: 18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) '@angular/platform-browser': specifier: ^18.2.7 - version: 18.2.8(@angular/animations@18.2.8)(@angular/common@18.2.8)(@angular/core@18.2.8) + version: 18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@angular/platform-browser-dynamic': specifier: ^18.2.7 - version: 18.2.8(@angular/common@18.2.8)(@angular/compiler@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8) + version: 18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))) '@angular/router': specifier: ^18.2.7 - version: 18.2.8(@angular/common@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8)(rxjs@7.8.1) + version: 18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) '@feel/form': specifier: ^0.0.25 - version: 0.0.25(@angular/cdk@17.3.10)(@angular/common@18.2.8)(@angular/core@18.2.8)(@feel/style@0.0.25) + version: 0.0.25(@angular/cdk@17.3.10(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@feel/style@0.0.25(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))) '@feel/style': specifier: ^0.0.25 - version: 0.0.25(@angular/common@18.2.8)(@angular/core@18.2.8) + version: 0.0.25(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@fontsource/dm-mono': specifier: ^5.1.0 version: 5.1.0 '@fontsource/dm-sans': specifier: ^5.1.0 version: 5.1.0 + '@nuschtos/fixx': + specifier: link:../ixx/result + version: link:../ixx/result rxjs: specifier: ~7.8.1 version: 7.8.1 @@ -56,13 +59,13 @@ importers: devDependencies: '@angular-devkit/build-angular': specifier: ^18.2.8 - version: 18.2.8(@angular/compiler-cli@18.2.8)(karma@6.4.4)(typescript@5.5.4) + version: 18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(@types/node@22.7.5)(chokidar@3.6.0)(karma@6.4.4)(typescript@5.5.4) '@angular/cli': specifier: ^18.2.8 - version: 18.2.8 + version: 18.2.8(chokidar@3.6.0) '@angular/compiler-cli': specifier: ^18.2.7 - version: 18.2.8(@angular/compiler@18.2.8)(typescript@5.5.4) + version: 18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4) '@angular/language-service': specifier: ^18.2.7 version: 18.2.8 @@ -86,7 +89,7 @@ importers: version: 5.1.0(karma@6.4.4) karma-jasmine-html-reporter: specifier: ~2.1.0 - version: 2.1.0(jasmine-core@5.3.0)(karma-jasmine@5.1.0)(karma@6.4.4) + version: 2.1.0(jasmine-core@5.3.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4) typescript: specifier: ~5.5.4 version: 5.5.4 @@ -4322,21 +4325,21 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@angular-devkit/architect@0.1802.8': + '@angular-devkit/architect@0.1802.8(chokidar@3.6.0)': dependencies: - '@angular-devkit/core': 18.2.8 + '@angular-devkit/core': 18.2.8(chokidar@3.6.0) rxjs: 7.8.1 transitivePeerDependencies: - chokidar - '@angular-devkit/build-angular@18.2.8(@angular/compiler-cli@18.2.8)(karma@6.4.4)(typescript@5.5.4)': + '@angular-devkit/build-angular@18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(@types/node@22.7.5)(chokidar@3.6.0)(karma@6.4.4)(typescript@5.5.4)': dependencies: '@ampproject/remapping': 2.3.0 - '@angular-devkit/architect': 0.1802.8 - '@angular-devkit/build-webpack': 0.1802.8(webpack-dev-server@5.0.4)(webpack@5.94.0) - '@angular-devkit/core': 18.2.8 - '@angular/build': 18.2.8(@angular/compiler-cli@18.2.8)(less@4.2.0)(postcss@8.4.41)(terser@5.31.6)(typescript@5.5.4) - '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8)(typescript@5.5.4) + '@angular-devkit/architect': 0.1802.8(chokidar@3.6.0) + '@angular-devkit/build-webpack': 0.1802.8(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.94.0))(webpack@5.94.0(esbuild@0.23.0)) + '@angular-devkit/core': 18.2.8(chokidar@3.6.0) + '@angular/build': 18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(@types/node@22.7.5)(chokidar@3.6.0)(less@4.2.0)(postcss@8.4.41)(terser@5.31.6)(typescript@5.5.4) + '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4) '@babel/core': 7.25.2 '@babel/generator': 7.25.0 '@babel/helper-annotate-as-pure': 7.24.7 @@ -4347,29 +4350,28 @@ snapshots: '@babel/preset-env': 7.25.3(@babel/core@7.25.2) '@babel/runtime': 7.25.0 '@discoveryjs/json-ext': 0.6.1 - '@ngtools/webpack': 18.2.8(@angular/compiler-cli@18.2.8)(typescript@5.5.4)(webpack@5.94.0) - '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.4.6) + '@ngtools/webpack': 18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.94.0(esbuild@0.23.0)) + '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6)) ansi-colors: 4.1.3 autoprefixer: 10.4.20(postcss@8.4.41) - babel-loader: 9.1.3(@babel/core@7.25.2)(webpack@5.94.0) + babel-loader: 9.1.3(@babel/core@7.25.2)(webpack@5.94.0(esbuild@0.23.0)) browserslist: 4.24.0 - copy-webpack-plugin: 12.0.2(webpack@5.94.0) + copy-webpack-plugin: 12.0.2(webpack@5.94.0(esbuild@0.23.0)) critters: 0.0.24 - css-loader: 7.1.2(webpack@5.94.0) + css-loader: 7.1.2(webpack@5.94.0(esbuild@0.23.0)) esbuild-wasm: 0.23.0 fast-glob: 3.3.2 http-proxy-middleware: 3.0.0 https-proxy-agent: 7.0.5 istanbul-lib-instrument: 6.0.3 jsonc-parser: 3.3.1 - karma: 6.4.4 karma-source-map-support: 1.4.0 less: 4.2.0 - less-loader: 12.2.0(less@4.2.0)(webpack@5.94.0) - license-webpack-plugin: 4.0.2(webpack@5.94.0) + less-loader: 12.2.0(less@4.2.0)(webpack@5.94.0(esbuild@0.23.0)) + license-webpack-plugin: 4.0.2(webpack@5.94.0(esbuild@0.23.0)) loader-utils: 3.3.1 magic-string: 0.30.11 - mini-css-extract-plugin: 2.9.0(webpack@5.94.0) + mini-css-extract-plugin: 2.9.0(webpack@5.94.0(esbuild@0.23.0)) mrmime: 2.0.0 open: 10.1.0 ora: 5.4.1 @@ -4377,27 +4379,28 @@ snapshots: picomatch: 4.0.2 piscina: 4.6.1 postcss: 8.4.41 - postcss-loader: 8.1.1(postcss@8.4.41)(typescript@5.5.4)(webpack@5.94.0) + postcss-loader: 8.1.1(postcss@8.4.41)(typescript@5.5.4)(webpack@5.94.0(esbuild@0.23.0)) resolve-url-loader: 5.0.0 rxjs: 7.8.1 sass: 1.77.6 - sass-loader: 16.0.0(sass@1.77.6)(webpack@5.94.0) + sass-loader: 16.0.0(sass@1.77.6)(webpack@5.94.0(esbuild@0.23.0)) semver: 7.6.3 - source-map-loader: 5.0.0(webpack@5.94.0) + source-map-loader: 5.0.0(webpack@5.94.0(esbuild@0.23.0)) source-map-support: 0.5.21 terser: 5.31.6 tree-kill: 1.2.2 tslib: 2.6.3 typescript: 5.5.4 - vite: 5.4.6(less@4.2.0)(sass@1.77.6)(terser@5.31.6) + vite: 5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6) watchpack: 2.4.1 webpack: 5.94.0(esbuild@0.23.0) webpack-dev-middleware: 7.4.2(webpack@5.94.0) webpack-dev-server: 5.0.4(webpack@5.94.0) webpack-merge: 6.0.1 - webpack-subresource-integrity: 5.1.0(webpack@5.94.0) + webpack-subresource-integrity: 5.1.0(webpack@5.94.0(esbuild@0.23.0)) optionalDependencies: esbuild: 0.23.0 + karma: 6.4.4 transitivePeerDependencies: - '@rspack/core' - '@swc/core' @@ -4416,16 +4419,16 @@ snapshots: - utf-8-validate - webpack-cli - '@angular-devkit/build-webpack@0.1802.8(webpack-dev-server@5.0.4)(webpack@5.94.0)': + '@angular-devkit/build-webpack@0.1802.8(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.94.0))(webpack@5.94.0(esbuild@0.23.0))': dependencies: - '@angular-devkit/architect': 0.1802.8 + '@angular-devkit/architect': 0.1802.8(chokidar@3.6.0) rxjs: 7.8.1 webpack: 5.94.0(esbuild@0.23.0) webpack-dev-server: 5.0.4(webpack@5.94.0) transitivePeerDependencies: - chokidar - '@angular-devkit/core@18.2.8': + '@angular-devkit/core@18.2.8(chokidar@3.6.0)': dependencies: ajv: 8.17.1 ajv-formats: 3.0.1(ajv@8.17.1) @@ -4433,10 +4436,12 @@ snapshots: picomatch: 4.0.2 rxjs: 7.8.1 source-map: 0.7.4 + optionalDependencies: + chokidar: 3.6.0 - '@angular-devkit/schematics@18.2.8': + '@angular-devkit/schematics@18.2.8(chokidar@3.6.0)': dependencies: - '@angular-devkit/core': 18.2.8 + '@angular-devkit/core': 18.2.8(chokidar@3.6.0) jsonc-parser: 3.3.1 magic-string: 0.30.11 ora: 5.4.1 @@ -4444,28 +4449,27 @@ snapshots: transitivePeerDependencies: - chokidar - '@angular/animations@18.2.8(@angular/core@18.2.8)': + '@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))': dependencies: '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) tslib: 2.7.0 - '@angular/build@18.2.8(@angular/compiler-cli@18.2.8)(less@4.2.0)(postcss@8.4.41)(terser@5.31.6)(typescript@5.5.4)': + '@angular/build@18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(@types/node@22.7.5)(chokidar@3.6.0)(less@4.2.0)(postcss@8.4.41)(terser@5.31.6)(typescript@5.5.4)': dependencies: '@ampproject/remapping': 2.3.0 - '@angular-devkit/architect': 0.1802.8 - '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8)(typescript@5.5.4) + '@angular-devkit/architect': 0.1802.8(chokidar@3.6.0) + '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4) '@babel/core': 7.25.2 '@babel/helper-annotate-as-pure': 7.24.7 '@babel/helper-split-export-declaration': 7.24.7 '@babel/plugin-syntax-import-attributes': 7.24.7(@babel/core@7.25.2) '@inquirer/confirm': 3.1.22 - '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.4.6) + '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6)) browserslist: 4.24.0 critters: 0.0.24 esbuild: 0.23.0 fast-glob: 3.3.2 https-proxy-agent: 7.0.5 - less: 4.2.0 listr2: 8.2.4 lmdb: 3.0.13 magic-string: 0.30.11 @@ -4473,13 +4477,15 @@ snapshots: parse5-html-rewriting-stream: 7.0.0 picomatch: 4.0.2 piscina: 4.6.1 - postcss: 8.4.41 rollup: 4.22.4 sass: 1.77.6 semver: 7.6.3 typescript: 5.5.4 - vite: 5.4.6(less@4.2.0)(sass@1.77.6)(terser@5.31.6) + vite: 5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6) watchpack: 2.4.1 + optionalDependencies: + less: 4.2.0 + postcss: 8.4.41 transitivePeerDependencies: - '@types/node' - chokidar @@ -4490,23 +4496,23 @@ snapshots: - supports-color - terser - '@angular/cdk@17.3.10(@angular/common@18.2.8)(@angular/core@18.2.8)(rxjs@7.8.1)': + '@angular/cdk@17.3.10(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1)': dependencies: - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) rxjs: 7.8.1 tslib: 2.7.0 optionalDependencies: parse5: 7.1.2 - '@angular/cli@18.2.8': + '@angular/cli@18.2.8(chokidar@3.6.0)': dependencies: - '@angular-devkit/architect': 0.1802.8 - '@angular-devkit/core': 18.2.8 - '@angular-devkit/schematics': 18.2.8 + '@angular-devkit/architect': 0.1802.8(chokidar@3.6.0) + '@angular-devkit/core': 18.2.8(chokidar@3.6.0) + '@angular-devkit/schematics': 18.2.8(chokidar@3.6.0) '@inquirer/prompts': 5.3.8 '@listr2/prompt-adapter-inquirer': 2.0.15(@inquirer/prompts@5.3.8) - '@schematics/angular': 18.2.8 + '@schematics/angular': 18.2.8(chokidar@3.6.0) '@yarnpkg/lockfile': 1.1.0 ini: 4.1.3 jsonc-parser: 3.3.1 @@ -4523,15 +4529,15 @@ snapshots: - chokidar - supports-color - '@angular/common@18.2.8(@angular/core@18.2.8)(rxjs@7.8.1)': + '@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1)': dependencies: '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) rxjs: 7.8.1 tslib: 2.7.0 - '@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8)(typescript@5.5.4)': + '@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4)': dependencies: - '@angular/compiler': 18.2.8(@angular/core@18.2.8) + '@angular/compiler': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@babel/core': 7.25.2 '@jridgewell/sourcemap-codec': 1.5.0 chokidar: 4.0.1 @@ -4544,10 +4550,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@angular/compiler@18.2.8(@angular/core@18.2.8)': + '@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))': dependencies: - '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) tslib: 2.7.0 + optionalDependencies: + '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) '@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)': dependencies: @@ -4555,36 +4562,37 @@ snapshots: tslib: 2.7.0 zone.js: 0.15.0 - '@angular/forms@18.2.8(@angular/common@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8)(rxjs@7.8.1)': + '@angular/forms@18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1)': dependencies: - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) - '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8)(@angular/common@18.2.8)(@angular/core@18.2.8) + '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) rxjs: 7.8.1 tslib: 2.7.0 '@angular/language-service@18.2.8': {} - '@angular/platform-browser-dynamic@18.2.8(@angular/common@18.2.8)(@angular/compiler@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8)': + '@angular/platform-browser-dynamic@18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))': dependencies: - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) - '@angular/compiler': 18.2.8(@angular/core@18.2.8) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) + '@angular/compiler': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) - '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8)(@angular/common@18.2.8)(@angular/core@18.2.8) + '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) tslib: 2.7.0 - '@angular/platform-browser@18.2.8(@angular/animations@18.2.8)(@angular/common@18.2.8)(@angular/core@18.2.8)': + '@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))': dependencies: - '@angular/animations': 18.2.8(@angular/core@18.2.8) - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) tslib: 2.7.0 + optionalDependencies: + '@angular/animations': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) - '@angular/router@18.2.8(@angular/common@18.2.8)(@angular/core@18.2.8)(@angular/platform-browser@18.2.8)(rxjs@7.8.1)': + '@angular/router@18.2.8(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1)': dependencies: - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) - '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8)(@angular/common@18.2.8)(@angular/core@18.2.8) + '@angular/platform-browser': 18.2.8(@angular/animations@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) rxjs: 7.8.1 tslib: 2.7.0 @@ -5554,17 +5562,17 @@ snapshots: '@esbuild/win32-x64@0.23.0': optional: true - '@feel/form@0.0.25(@angular/cdk@17.3.10)(@angular/common@18.2.8)(@angular/core@18.2.8)(@feel/style@0.0.25)': + '@feel/form@0.0.25(@angular/cdk@17.3.10(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(@feel/style@0.0.25(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))': dependencies: - '@angular/cdk': 17.3.10(@angular/common@18.2.8)(@angular/core@18.2.8)(rxjs@7.8.1) - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/cdk': 17.3.10(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) - '@feel/style': 0.0.25(@angular/common@18.2.8)(@angular/core@18.2.8) + '@feel/style': 0.0.25(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)) tslib: 2.7.0 - '@feel/style@0.0.25(@angular/common@18.2.8)(@angular/core@18.2.8)': + '@feel/style@0.0.25(@angular/common@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))': dependencies: - '@angular/common': 18.2.8(@angular/core@18.2.8)(rxjs@7.8.1) + '@angular/common': 18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 18.2.8(rxjs@7.8.1)(zone.js@0.15.0) tslib: 2.7.0 @@ -5769,9 +5777,9 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true - '@ngtools/webpack@18.2.8(@angular/compiler-cli@18.2.8)(typescript@5.5.4)(webpack@5.94.0)': + '@ngtools/webpack@18.2.8(@angular/compiler-cli@18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.94.0(esbuild@0.23.0))': dependencies: - '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8)(typescript@5.5.4) + '@angular/compiler-cli': 18.2.8(@angular/compiler@18.2.8(@angular/core@18.2.8(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.5.4) typescript: 5.5.4 webpack: 5.94.0(esbuild@0.23.0) @@ -5951,10 +5959,10 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.24.0': optional: true - '@schematics/angular@18.2.8': + '@schematics/angular@18.2.8(chokidar@3.6.0)': dependencies: - '@angular-devkit/core': 18.2.8 - '@angular-devkit/schematics': 18.2.8 + '@angular-devkit/core': 18.2.8(chokidar@3.6.0) + '@angular-devkit/schematics': 18.2.8(chokidar@3.6.0) jsonc-parser: 3.3.1 transitivePeerDependencies: - chokidar @@ -6106,9 +6114,9 @@ snapshots: dependencies: '@types/node': 22.7.5 - '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.6)': + '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6))': dependencies: - vite: 5.4.6(less@4.2.0)(sass@1.77.6)(terser@5.31.6) + vite: 5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6) '@webassemblyjs/ast@1.12.1': dependencies: @@ -6222,11 +6230,11 @@ snapshots: indent-string: 4.0.0 ajv-formats@2.1.1(ajv@8.17.1): - dependencies: + optionalDependencies: ajv: 8.17.1 ajv-formats@3.0.1(ajv@8.17.1): - dependencies: + optionalDependencies: ajv: 8.17.1 ajv-keywords@3.5.2(ajv@6.12.6): @@ -6297,7 +6305,7 @@ snapshots: postcss: 8.4.41 postcss-value-parser: 4.2.0 - babel-loader@9.1.3(@babel/core@7.25.2)(webpack@5.94.0): + babel-loader@9.1.3(@babel/core@7.25.2)(webpack@5.94.0(esbuild@0.23.0)): dependencies: '@babel/core': 7.25.2 find-cache-dir: 4.0.0 @@ -6571,7 +6579,7 @@ snapshots: dependencies: is-what: 3.14.1 - copy-webpack-plugin@12.0.2(webpack@5.94.0): + copy-webpack-plugin@12.0.2(webpack@5.94.0(esbuild@0.23.0)): dependencies: fast-glob: 3.3.2 glob-parent: 6.0.2 @@ -6598,6 +6606,7 @@ snapshots: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 + optionalDependencies: typescript: 5.5.4 critters@0.0.24: @@ -6616,7 +6625,7 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - css-loader@7.1.2(webpack@5.94.0): + css-loader@7.1.2(webpack@5.94.0(esbuild@0.23.0)): dependencies: icss-utils: 5.1.0(postcss@8.4.41) postcss: 8.4.41 @@ -6626,6 +6635,7 @@ snapshots: postcss-modules-values: 4.0.0(postcss@8.4.41) postcss-value-parser: 4.2.0 semver: 7.6.3 + optionalDependencies: webpack: 5.94.0(esbuild@0.23.0) css-select@5.1.0: @@ -6999,7 +7009,7 @@ snapshots: flatted@3.3.1: {} follow-redirects@1.15.9(debug@4.3.7): - dependencies: + optionalDependencies: debug: 4.3.7 foreground-child@3.3.0: @@ -7165,12 +7175,13 @@ snapshots: http-proxy-middleware@2.0.7(@types/express@4.17.21): dependencies: - '@types/express': 4.17.21 '@types/http-proxy': 1.17.15 http-proxy: 1.18.1(debug@4.3.7) is-glob: 4.0.3 is-plain-obj: 3.0.0 micromatch: 4.0.8 + optionalDependencies: + '@types/express': 4.17.21 transitivePeerDependencies: - debug @@ -7426,7 +7437,7 @@ snapshots: transitivePeerDependencies: - supports-color - karma-jasmine-html-reporter@2.1.0(jasmine-core@5.3.0)(karma-jasmine@5.1.0)(karma@6.4.4): + karma-jasmine-html-reporter@2.1.0(jasmine-core@5.3.0)(karma-jasmine@5.1.0(karma@6.4.4))(karma@6.4.4): dependencies: jasmine-core: 5.3.0 karma: 6.4.4 @@ -7480,9 +7491,10 @@ snapshots: picocolors: 1.1.0 shell-quote: 1.8.1 - less-loader@12.2.0(less@4.2.0)(webpack@5.94.0): + less-loader@12.2.0(less@4.2.0)(webpack@5.94.0(esbuild@0.23.0)): dependencies: less: 4.2.0 + optionalDependencies: webpack: 5.94.0(esbuild@0.23.0) less@4.2.0: @@ -7499,10 +7511,11 @@ snapshots: needle: 3.3.1 source-map: 0.6.1 - license-webpack-plugin@4.0.2(webpack@5.94.0): + license-webpack-plugin@4.0.2(webpack@5.94.0(esbuild@0.23.0)): dependencies: - webpack: 5.94.0(esbuild@0.23.0) webpack-sources: 3.2.3 + optionalDependencies: + webpack: 5.94.0(esbuild@0.23.0) lines-and-columns@1.2.4: {} @@ -7646,7 +7659,7 @@ snapshots: mimic-function@5.0.1: {} - mini-css-extract-plugin@2.9.0(webpack@5.94.0): + mini-css-extract-plugin@2.9.0(webpack@5.94.0(esbuild@0.23.0)): dependencies: schema-utils: 4.2.0 tapable: 2.2.1 @@ -8005,12 +8018,13 @@ snapshots: dependencies: find-up: 6.3.0 - postcss-loader@8.1.1(postcss@8.4.41)(typescript@5.5.4)(webpack@5.94.0): + postcss-loader@8.1.1(postcss@8.4.41)(typescript@5.5.4)(webpack@5.94.0(esbuild@0.23.0)): dependencies: cosmiconfig: 9.0.0(typescript@5.5.4) jiti: 1.21.6 postcss: 8.4.41 semver: 7.6.3 + optionalDependencies: webpack: 5.94.0(esbuild@0.23.0) transitivePeerDependencies: - typescript @@ -8262,9 +8276,10 @@ snapshots: safer-buffer@2.1.2: {} - sass-loader@16.0.0(sass@1.77.6)(webpack@5.94.0): + sass-loader@16.0.0(sass@1.77.6)(webpack@5.94.0(esbuild@0.23.0)): dependencies: neo-async: 2.6.2 + optionalDependencies: sass: 1.77.6 webpack: 5.94.0(esbuild@0.23.0) @@ -8459,7 +8474,7 @@ snapshots: source-map-js@1.2.1: {} - source-map-loader@5.0.0(webpack@5.94.0): + source-map-loader@5.0.0(webpack@5.94.0(esbuild@0.23.0)): dependencies: iconv-lite: 0.6.3 source-map-js: 1.2.1 @@ -8593,12 +8608,13 @@ snapshots: terser-webpack-plugin@5.3.10(esbuild@0.23.0)(webpack@5.94.0): dependencies: '@jridgewell/trace-mapping': 0.3.25 - esbuild: 0.23.0 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.6 webpack: 5.94.0(esbuild@0.23.0) + optionalDependencies: + esbuild: 0.23.0 terser@5.31.6: dependencies: @@ -8710,16 +8726,17 @@ snapshots: vary@1.1.2: {} - vite@5.4.6(less@4.2.0)(sass@1.77.6)(terser@5.31.6): + vite@5.4.6(@types/node@22.7.5)(less@4.2.0)(sass@1.77.6)(terser@5.31.6): dependencies: esbuild: 0.21.5 - less: 4.2.0 postcss: 8.4.47 rollup: 4.24.0 - sass: 1.77.6 - terser: 5.31.6 optionalDependencies: + '@types/node': 22.7.5 fsevents: 2.3.3 + less: 4.2.0 + sass: 1.77.6 + terser: 5.31.6 void-elements@2.0.1: {} @@ -8746,6 +8763,7 @@ snapshots: on-finished: 2.4.1 range-parser: 1.2.1 schema-utils: 4.2.0 + optionalDependencies: webpack: 5.94.0(esbuild@0.23.0) webpack-dev-server@5.0.4(webpack@5.94.0): @@ -8778,9 +8796,10 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack: 5.94.0(esbuild@0.23.0) webpack-dev-middleware: 7.4.2(webpack@5.94.0) ws: 8.18.0 + optionalDependencies: + webpack: 5.94.0(esbuild@0.23.0) transitivePeerDependencies: - bufferutil - debug @@ -8795,7 +8814,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack-subresource-integrity@5.1.0(webpack@5.94.0): + webpack-subresource-integrity@5.1.0(webpack@5.94.0(esbuild@0.23.0)): dependencies: typed-assert: 1.0.9 webpack: 5.94.0(esbuild@0.23.0) diff --git a/public/fixx_bg.wasm b/public/fixx_bg.wasm new file mode 120000 index 0000000..99d66b3 --- /dev/null +++ b/public/fixx_bg.wasm @@ -0,0 +1 @@ +../node_modules/@nuschtos/fixx/fixx_bg.wasm \ No newline at end of file diff --git a/src/app/core/components/search/search.component.html b/src/app/core/components/search/search.component.html index fe8a8a9..2d8e94f 100644 --- a/src/app/core/components/search/search.component.html +++ b/src/app/core/components/search/search.component.html @@ -9,5 +9,5 @@ -

Only showing the first 500 results. Make your search term more concise.

+

Only showing the first {{maxSearchResults}} results. Make your search term more concise.

diff --git a/src/app/core/components/search/search.component.ts b/src/app/core/components/search/search.component.ts index 69929ce..a3df593 100644 --- a/src/app/core/components/search/search.component.ts +++ b/src/app/core/components/search/search.component.ts @@ -1,7 +1,7 @@ import { AfterViewInit, ChangeDetectionStrategy, Component } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { Observable, map, switchMap } from 'rxjs'; -import { SearchService, Option } from '../../data/search.service'; +import { Observable, map, of, switchMap } from 'rxjs'; +import { MAX_SEARCH_RESULTS, SearchService, SearchedOption } from '../../data/search.service'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { TextFieldComponent } from "@feel/form"; import { AsyncPipe, NgFor, NgIf } from '@angular/common'; @@ -24,15 +24,15 @@ export class SearchComponent implements AfterViewInit { protected readonly results = this.search.valueChanges.pipe( switchMap(query => { const q = query?.trim(); - if (q !== getQuery()) this.router.navigate([], { queryParams: { query: q }, queryParamsHandling: 'merge' }); - if (q && q.length > 0) { - return this.searchService.search(q); - } else { - return this.searchService.all(); + if (q !== getQuery()) { + this.router.navigate([], { queryParams: { query: q }, queryParamsHandling: 'merge' }); } + return this.searchService.search(q); }), ); + protected readonly selectedOption = this.activatedRoute.queryParams.pipe(map(({ option }) => option)); + protected readonly maxSearchResults = MAX_SEARCH_RESULTS; constructor( private readonly searchService: SearchService, @@ -45,12 +45,12 @@ export class SearchComponent implements AfterViewInit { this.search.setValue(getQuery()); } - protected trackBy(_idx: number, { name }: Option): string { - return name; + protected trackBy(_idx: number, option: SearchedOption): number { + return option.idx; } - protected isActive({ name }: Option): Observable { - return this.selectedOption.pipe(map(option => option === name)); + protected isActive(opt: SearchedOption): Observable { + return this.selectedOption.pipe(map(option => option === opt.name)); } } diff --git a/src/app/core/data/search.service.ts b/src/app/core/data/search.service.ts index 608b431..54ab43c 100644 --- a/src/app/core/data/search.service.ts +++ b/src/app/core/data/search.service.ts @@ -1,6 +1,15 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { BehaviorSubject, Observable, map, of } from 'rxjs'; +import __wbg_init, { Index } from '@nuschtos/fixx'; +import { BehaviorSubject, Observable, from, map, of, switchMap, tap } from 'rxjs'; + +export interface SearchedOption { + idx: number; + name: string; +} + +const CHUNK_SIZE = 100; +export const MAX_SEARCH_RESULTS=500; // https://transform.tools/json-to-typescript export interface Option { @@ -18,79 +27,58 @@ export interface Option { }) export class SearchService { - private nextUpdate = 0; - private readonly data = new BehaviorSubject([]); + private readonly index = new BehaviorSubject(null); + private readonly data = new BehaviorSubject>({}); constructor( private readonly http: HttpClient, - ) { } - - private update() { - const now = Date.now(); - if (this.nextUpdate < now) { - this.nextUpdate = now + 1000 * 60 * 10; - this.http.get>>(`${document.getElementsByTagName('base')[0].href}options.json`) - .subscribe(data => this.data.next(Object.entries(data).map(([name, data]) => ({ name, ...data })))); - } + ) { + from(__wbg_init(`${document.getElementsByTagName('base')[0].href}fixx_bg.wasm`)) + .pipe(switchMap(() => this.http.get(`${document.getElementsByTagName('base')[0].href}index.ixx`, { responseType: 'arraybuffer' }))) + .subscribe(data => this.index.next(Index.read(new Uint8Array(data)))); } - public search(query: string): Observable { - this.update(); - - const search = query.toLowerCase().split('*'); - if (search.length === 0) { - return of([]); - } - - return this.data.pipe(map(options => { - const result = []; + public search(query: string | null | undefined): Observable { + return this.index.pipe( + map(index => { + return index ? (query && query.length > 0 ? index.search(query, MAX_SEARCH_RESULTS).map(option => { + const opt = ({ idx: option.idx(), name: option.name() }); + // option.free(); + return opt; + }) : index.all(MAX_SEARCH_RESULTS).map((name, idx) => ({ idx, name }))) : []; + }) + ); + } - let i = 0; + public getByName(name: string | undefined): Observable