From bf2bec0c3d673cf0b833685bb1f9ba956862b9b6 Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Tue, 24 Jun 2025 12:18:32 -0700 Subject: [PATCH] feature: add support for setting an FSDB_ROOT environment variable --- deno.json | 2 +- fsdb.ts | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/deno.json b/deno.json index 4881b4f..814170e 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@andyburke/fsdb", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT", "exports": { ".": "./fsdb.ts", diff --git a/fsdb.ts b/fsdb.ts index 3a2f1d6..b396716 100644 --- a/fsdb.ts +++ b/fsdb.ts @@ -34,7 +34,7 @@ export class FSDB_COLLECTION> { ...{ id_field: 'id', organize: by_lurid, - root: `./.fsdb/${input_config?.name ?? 'unknown'}` + root: `${Deno.env.get('FSDB_ROOT') ?? './fsdb'}/${input_config?.name ?? 'unknown'}` }, ...(input_config ?? {}) }; @@ -214,20 +214,6 @@ export class FSDB_COLLECTION> { const results: T[] = []; const item_paths: string[] = []; - // for each key in the search - // see if we have an index for it - // if we have an index, use that index to put any search path right at the beginning of the list - // - // once we have a list of items to search - // apply offset - // for each item, load it - // let matched = false; - // for each key in search - // if the item matches this key/value, matched = true; break; - // if limit reached, break; - // - // return matched items - for (const search_key of Object.keys(criteria)) { const indexer_for_search_key: FSDB_INDEXER | undefined = this.INDEX[search_key]; const value: string = criteria[search_key];