@opengis/fastify-table 2.0.35 → 2.0.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getSelectVal.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/metaFormat/getSelectVal.ts"],"names":[],"mappings":"AAaA,wBAA8B,YAAY,CAAC,EACzC,EAAqB,EACrB,IAAI,EACJ,MAAM,EAAE,YAAY,EACpB,EAAU,GACX,EAAE,GAAG,gBA2FL"}
1
+ {"version":3,"file":"getSelectVal.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/metaFormat/getSelectVal.ts"],"names":[],"mappings":"AAaA,wBAA8B,YAAY,CAAC,EACzC,EAAqB,EACrB,IAAI,EACJ,MAAM,EAAE,YAAY,EACpB,EAAU,GACX,EAAE,GAAG,gBAmGL"}
@@ -33,7 +33,7 @@ export default async function getSelectVal({ pg = pgClients.client, name, values
33
33
  const id = selectIds[name];
34
34
  // cache
35
35
  const key = `select:${name}`;
36
- const cache = values?.length && config.redis
36
+ const cache = values?.length && config.redis && !config.disableCache
37
37
  ? (await rclient.hmget(key, values)).reduce((p, el, i) => ({
38
38
  ...p,
39
39
  [values[i]]: el,
@@ -58,7 +58,10 @@ export default async function getSelectVal({ pg = pgClients.client, name, values
58
58
  [el.id.toString()]: el.color ? el : el.text,
59
59
  }), {}),
60
60
  };
61
- if (data?.length && config.redis) {
61
+ const cacheableValues = Object.entries(clsObj).find(([key, val]) => typeof val !== "object")
62
+ ? Object.fromEntries(Object.entries(clsObj).filter(([key, val]) => typeof val !== "object"))
63
+ : null;
64
+ if (data?.length && config.redis && cacheableValues) {
62
65
  rclient.hmset(key, clsObj);
63
66
  }
64
67
  if (ar) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.35",
3
+ "version": "2.0.36",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [