zet-lib 1.0.42 → 1.0.43

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/lib/connection.js CHANGED
@@ -292,7 +292,6 @@ connection.constraintList = (table, schema = "public") => {
292
292
  INNER JOIN pg_catalog.pg_namespace nsp
293
293
  ON nsp.oid = connamespace
294
294
  WHERE nsp.nspname = '${schema}' AND rel.relname = '${table}'; `;
295
-
296
295
  }
297
296
 
298
297
  var toNumber = function (num) {
package/lib/zRoute.js CHANGED
@@ -3288,11 +3288,13 @@ zRoute.modelsCache = async() => {
3288
3288
  const splits = key.split("___") || [];
3289
3289
  let item = splits.length > 1 ? splits[1] : key;
3290
3290
  let arr = [];
3291
- for (const result of results) {
3292
- arr.push({id: result.id, zname: result[item]});
3291
+ if(results.length) {
3292
+ for (const result of results) {
3293
+ arr.push({id: result.id, zname: result[item]});
3294
+ }
3295
+ const myarray = Util.sortArray(arr, 'zname');
3296
+ myCache.set(`${keys}_${key}_${company.id}`, myarray);
3293
3297
  }
3294
- const myarray = Util.sortArray(arr, 'zname');
3295
- myCache.set(`${keys}_${key}_${company.id}`, myarray);
3296
3298
  }
3297
3299
  }
3298
3300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"