@nestjs/common 9.1.3 → 9.1.4

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.
@@ -13,26 +13,19 @@ const default_options_1 = require("./default-options");
13
13
  function createCacheManager() {
14
14
  return {
15
15
  provide: cache_constants_1.CACHE_MANAGER,
16
- useFactory: async (options) => {
16
+ useFactory: (options) => {
17
17
  const cacheManager = (0, load_package_util_1.loadPackage)('cache-manager', 'CacheModule', () => require('cache-manager'));
18
18
  // eslint-disable-next-line @typescript-eslint/no-var-requires
19
19
  const cacheManagerVersion = require('cache-manager/package.json').version;
20
20
  const cacheManagerMajor = cacheManagerVersion.split('.')[0];
21
- const cachingFactory = async (store, options) => {
21
+ const cachingFactory = (store, options) => {
22
22
  if (cacheManagerMajor < 5) {
23
23
  return cacheManager.caching(Object.assign(Object.assign({}, default_options_1.defaultCacheOptions), Object.assign(Object.assign({}, options), { store })));
24
24
  }
25
- let cache = 'memory';
26
- if (typeof store === 'object' && 'create' in store) {
27
- cache = store.create;
28
- }
29
- else if (typeof store === 'function') {
30
- cache = store;
31
- }
32
- return cacheManager.caching(cache, Object.assign(Object.assign({}, default_options_1.defaultCacheOptions), options));
25
+ return cacheManager.caching(store !== null && store !== void 0 ? store : 'memory', Object.assign(Object.assign({}, default_options_1.defaultCacheOptions), options));
33
26
  };
34
27
  return Array.isArray(options)
35
- ? cacheManager.multiCaching(await Promise.all(options.map(option => cachingFactory(option.store, option))))
28
+ ? cacheManager.multiCaching(options.map(option => cachingFactory(options.store, option)))
36
29
  : cachingFactory(options.store, options);
37
30
  },
38
31
  inject: [cache_module_definition_1.MODULE_OPTIONS_TOKEN],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "9.1.3",
3
+ "version": "9.1.4",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",