Skip to content

Commit

Permalink
0.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
victorteokw committed Dec 10, 2024
1 parent 48af63a commit 7cf6b27
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "teodevgroup_teo_docs_search_engine"
version = "0.0.10"
version = "0.0.11"

[lib]
crate-type = ["cdylib"]
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export interface Record {
urlPath: string
content: string
}
export class SearchIndex {
constructor()
export declare class SearchIndex {
constructor(dir: string)
clear(): void
insert(records: Array<Record>): void
search(text: string): Array<Record>
Expand Down
35 changes: 25 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,32 @@ switch (platform) {
}
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'teo-docs-search-engine.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./teo-docs-search-engine.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@teodevgroup/teo-docs-search-engine-linux-arm-gnueabihf')
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'teo-docs-search-engine.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./teo-docs-search-engine.linux-arm-musleabihf.node')
} else {
nativeBinding = require('@teodevgroup/teo-docs-search-engine-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'teo-docs-search-engine.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./teo-docs-search-engine.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@teodevgroup/teo-docs-search-engine-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
} catch (e) {
loadError = e
}
break
case 'riscv64':
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teodevgroup/teo-docs-search-engine",
"version": "0.0.10",
"version": "0.0.11",
"main": "index.js",
"types": "index.d.ts",
"napi": {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#[macro_use]
extern crate napi_derive;

use std::env::current_dir;
use std::fs;
use std::path::Path;
use once_cell::sync::Lazy;
Expand Down

0 comments on commit 7cf6b27

Please sign in to comment.