@zenweb/cache 4.2.0 → 4.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.2.1] - 2023-8-23
4
+ fix: 内容未压缩,客户端支持压缩内容时却标识为压缩内容
5
+
3
6
  ## [4.2.0] - 2023-8-22
4
7
  更新: cached 中间件支持 null key,不使用缓存
5
8
 
package/dist/cache.js CHANGED
@@ -122,7 +122,7 @@ class Cache {
122
122
  if ((_opt === null || _opt === void 0 ? void 0 : _opt.parse) !== false) {
123
123
  return obj;
124
124
  }
125
- return new CacheResult(!opt.decompress, !opt.decompress && result.compressed || Buffer.from(result.data));
125
+ return new CacheResult(!opt.decompress && Boolean(result.compressed), !opt.decompress && result.compressed || Buffer.from(result.data));
126
126
  };
127
127
  // 预刷新处理
128
128
  const preRefresh = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenweb/cache",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Zenweb Cache module",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",