@danielsimonjr/memoryjs 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1971,7 +1971,6 @@ function getPaginationMeta(totalCount, offset = 0, limit = SEARCH_LIMITS.DEFAULT
|
|
|
1971
1971
|
// src/utils/entityUtils.ts
|
|
1972
1972
|
var import_fs2 = require("fs");
|
|
1973
1973
|
var import_path = __toESM(require("path"), 1);
|
|
1974
|
-
var import_url = require("url");
|
|
1975
1974
|
function fnv1aHash(text) {
|
|
1976
1975
|
let hash = 2166136261;
|
|
1977
1976
|
for (let i = 0; i < text.length; i++) {
|
|
@@ -2232,20 +2231,13 @@ function validateFilePath(filePath, baseDir = process.cwd()) {
|
|
|
2232
2231
|
}
|
|
2233
2232
|
return finalNormalized;
|
|
2234
2233
|
}
|
|
2235
|
-
var defaultMemoryPath = import_path.default.join(
|
|
2236
|
-
import_path.default.dirname((0, import_url.fileURLToPath)(importMetaUrl)),
|
|
2237
|
-
"../../memory.jsonl"
|
|
2238
|
-
);
|
|
2234
|
+
var defaultMemoryPath = import_path.default.join(process.cwd(), "memory.jsonl");
|
|
2239
2235
|
async function ensureMemoryFilePath() {
|
|
2240
2236
|
if (process.env.MEMORY_FILE_PATH) {
|
|
2241
|
-
const
|
|
2242
|
-
const validatedPath = validateFilePath(process.env.MEMORY_FILE_PATH, baseDir);
|
|
2237
|
+
const validatedPath = validateFilePath(process.env.MEMORY_FILE_PATH, process.cwd());
|
|
2243
2238
|
return validatedPath;
|
|
2244
2239
|
}
|
|
2245
|
-
const oldMemoryPath = import_path.default.join(
|
|
2246
|
-
import_path.default.dirname((0, import_url.fileURLToPath)(importMetaUrl)),
|
|
2247
|
-
"../../memory.json"
|
|
2248
|
-
);
|
|
2240
|
+
const oldMemoryPath = import_path.default.join(process.cwd(), "memory.json");
|
|
2249
2241
|
const newMemoryPath = defaultMemoryPath;
|
|
2250
2242
|
try {
|
|
2251
2243
|
await import_fs2.promises.access(oldMemoryPath);
|
|
@@ -10141,7 +10133,7 @@ var BooleanSearch = class {
|
|
|
10141
10133
|
|
|
10142
10134
|
// src/search/FuzzySearch.ts
|
|
10143
10135
|
var import_workerpool4 = __toESM(require("@danielsimonjr/workerpool"), 1);
|
|
10144
|
-
var
|
|
10136
|
+
var import_url = require("url");
|
|
10145
10137
|
var import_path3 = require("path");
|
|
10146
10138
|
var DEFAULT_FUZZY_THRESHOLD = 0.7;
|
|
10147
10139
|
var FUZZY_CACHE_MAX_SIZE = 100;
|
|
@@ -10153,7 +10145,7 @@ var FuzzySearch = class {
|
|
|
10153
10145
|
this.storage = storage;
|
|
10154
10146
|
this.useWorkerPool = options.useWorkerPool ?? true;
|
|
10155
10147
|
const currentFileUrl = importMetaUrl;
|
|
10156
|
-
const currentDir = (0, import_path3.dirname)((0,
|
|
10148
|
+
const currentDir = (0, import_path3.dirname)((0, import_url.fileURLToPath)(currentFileUrl));
|
|
10157
10149
|
const isRunningFromSrc = currentDir.includes(`${import_path3.sep}src${import_path3.sep}`);
|
|
10158
10150
|
if (isRunningFromSrc) {
|
|
10159
10151
|
const projectRoot = (0, import_path3.join)(currentDir, "..", "..");
|