@xuda.io/account_module 1.2.2224 → 1.2.2225

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.
Files changed (2) hide show
  1. package/index.mjs +8 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3376,6 +3376,13 @@ export const save_xuda_cache = async function (uid, docType, key, file, metadata
3376
3376
  const cache = await get_xuda_cache(uid, docType, key);
3377
3377
  if (cache) return;
3378
3378
 
3379
+ const keyWords = key
3380
+ .trim()
3381
+ .toLowerCase()
3382
+ .split(/\s+/)
3383
+ .filter((w) => w.length > 1)
3384
+ .filter((w, i, arr) => arr.indexOf(w) === i); // deduplicate
3385
+
3379
3386
  let doc = {
3380
3387
  _id: await _common.xuda_get_uuid('cache'),
3381
3388
  key: key.toLowerCase().trim(),
@@ -3385,6 +3392,7 @@ export const save_xuda_cache = async function (uid, docType, key, file, metadata
3385
3392
  date_created_ts: Date.now(),
3386
3393
  metadata,
3387
3394
  hits: 0,
3395
+ keyWords,
3388
3396
  };
3389
3397
  const save_ret = await db_module.save_couch_doc('xuda_cache', doc);
3390
3398
  return save_ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2224",
3
+ "version": "1.2.2225",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {