@nocobase/cache 0.9.1-alpha.2 → 0.9.2-alpha.2

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/lib/index.js +1 -15
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -5,23 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createCache = createCache;
7
7
  exports.createDefaultCacheConfig = createDefaultCacheConfig;
8
-
9
8
  function _cacheManager() {
10
9
  const data = require("cache-manager");
11
-
12
10
  _cacheManager = function _cacheManager() {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
20
-
21
16
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
-
23
17
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
24
-
25
18
  /**
26
19
  * create a default cache config object
27
20
  * @returns {ICacheConfig}
@@ -39,8 +32,6 @@ function createDefaultCacheConfig() {
39
32
  * @param {ICacheConfig | ICacheConfig[]} cacheConfig
40
33
  * @returns {Cache}
41
34
  */
42
-
43
-
44
35
  function createCache(cacheConfig = createDefaultCacheConfig()) {
45
36
  if (Array.isArray(cacheConfig)) {
46
37
  // multi cache
@@ -48,10 +39,8 @@ function createCache(cacheConfig = createDefaultCacheConfig()) {
48
39
  return createCacheByICacheConfig(cacheConfig[0]);
49
40
  } else {
50
41
  let caches = [];
51
-
52
42
  var _iterator = _createForOfIteratorHelper(cacheConfig),
53
- _step;
54
-
43
+ _step;
55
44
  try {
56
45
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
57
46
  const cacheConfigEle = _step.value;
@@ -62,19 +51,16 @@ function createCache(cacheConfig = createDefaultCacheConfig()) {
62
51
  } finally {
63
52
  _iterator.f();
64
53
  }
65
-
66
54
  return (0, _cacheManager().multiCaching)(caches);
67
55
  }
68
56
  } else {
69
57
  return createCacheByICacheConfig(cacheConfig);
70
58
  }
71
59
  }
72
-
73
60
  function createCacheByICacheConfig(cacheConfig) {
74
61
  // if storePackage exist then load storePackage and instead store
75
62
  if (cacheConfig.storePackage) {
76
63
  cacheConfig.store = require(cacheConfig.storePackage);
77
64
  }
78
-
79
65
  return (0, _cacheManager().caching)(cacheConfig);
80
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cache",
3
- "version": "0.9.1-alpha.2",
3
+ "version": "0.9.2-alpha.2",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",
@@ -17,5 +17,5 @@
17
17
  "url": "git+https://github.com/nocobase/nocobase.git",
18
18
  "directory": "packages/cache"
19
19
  },
20
- "gitHead": "d588a68eca4feed4642a4cb317301011266fe5c9"
20
+ "gitHead": "1a0de6908b2b1854bdf434fcafa8909cb65bb8a3"
21
21
  }