spice-js 2.6.10 → 2.6.11

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.
@@ -11,16 +11,22 @@ function connect() {
11
11
  function _connect() {
12
12
  _connect = _asyncToGenerator(function* () {
13
13
  try {
14
+ var _spice$config, _spice$config$cache;
15
+
14
16
  spice.cache_providers = {};
15
17
  spice.monitor = new Map();
16
18
 
17
- for (var key of Object.keys(spice.config.cache.providers)) {
18
- spice.cache_providers[key] = new spice.config.cache.providers[key](spice.config.cache.drivers[key] || {});
19
- spice.cache_providers[key].initialize().then(() => {
20
- console.log("Redis initialized successfully");
21
- }).catch(err => {
22
- console.error("Error initializing Redis:", err);
23
- });
19
+ if ((_spice$config = spice.config) == null ? void 0 : (_spice$config$cache = _spice$config.cache) == null ? void 0 : _spice$config$cache.providers) {
20
+ for (var key of Object.keys(((_spice$config$cache2 = spice.config.cache) == null ? void 0 : _spice$config$cache2.providers) || {})) {
21
+ var _spice$config$cache2;
22
+
23
+ spice.cache_providers[key] = new spice.config.cache.providers[key](spice.config.cache.drivers[key] || {});
24
+ spice.cache_providers[key].initialize().then(() => {
25
+ console.log("Redis initialized successfully");
26
+ }).catch(err => {
27
+ console.error("Error initializing Redis:", err);
28
+ });
29
+ }
24
30
  }
25
31
  } catch (e) {
26
32
  console.log(e.stack);
@@ -212,8 +212,14 @@ class SpiceModel {
212
212
  }
213
213
 
214
214
  if (_this[_ctx]) {
215
- var returned = yield new _this[_ctx].state.process_fields().process(_this[_ctx], data, _this.type);
216
- return returned;
215
+ var _this$_ctx, _this$_ctx$state;
216
+
217
+ if ((_this$_ctx = _this[_ctx]) == null ? void 0 : (_this$_ctx$state = _this$_ctx.state) == null ? void 0 : _this$_ctx$state.process_fields) {
218
+ var returned = yield new _this[_ctx].state.process_fields().process(_this[_ctx], data, _this.type);
219
+ return returned;
220
+ } else {
221
+ return data;
222
+ }
217
223
  }
218
224
 
219
225
  return [];
@@ -561,6 +567,7 @@ class SpiceModel {
561
567
  }
562
568
  }
563
569
  } catch (e) {
570
+ console.log(e.message, e);
564
571
  throw e;
565
572
  }
566
573
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.6.10",
3
+ "version": "2.6.11",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {