@middy/util 4.0.0-alpha.4 → 4.0.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/README.md CHANGED
@@ -36,26 +36,6 @@
36
36
  <p>You can read the documentation at: <a href="https://middy.js.org/docs/intro/utilities">https://middy.js.org/docs/intro/utilities</a></p>
37
37
  </div>
38
38
 
39
-
40
- ## Install
41
-
42
- To install middy you can use NPM:
43
-
44
- ```bash
45
- npm install --save @middy/util
46
- ```
47
-
48
-
49
- ## Documentation and examples
50
-
51
- For documentation and examples, refers to the main [Middy monorepo on GitHub](https://github.com/middyjs/middy) or [Middy official website](https://middy.js.org).
52
-
53
-
54
- ## Contributing
55
-
56
- Everyone is very welcome to contribute to this repository. Feel free to [raise issues](https://github.com/middyjs/middy/issues) or to [submit Pull Requests](https://github.com/middyjs/middy/pulls).
57
-
58
-
59
39
  ## License
60
40
 
61
41
  Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
package/index.cjs CHANGED
@@ -108,13 +108,13 @@ const processCache = (options, fetch = ()=>undefined, request)=>{
108
108
  const unexpired = cached.expiry && (cacheExpiry < 0 || cached.expiry > Date.now());
109
109
  if (unexpired && cached.modified) {
110
110
  const value = fetch(request, cached.value);
111
- cache[cacheKey] = {
111
+ cache[cacheKey] = Object.create({
112
112
  value: {
113
113
  ...cached.value,
114
114
  ...value
115
115
  },
116
116
  expiry: cached.expiry
117
- };
117
+ });
118
118
  return cache[cacheKey];
119
119
  }
120
120
  if (unexpired) {
package/index.js CHANGED
@@ -82,13 +82,13 @@ export const processCache = (options, fetch = ()=>undefined, request)=>{
82
82
  const unexpired = cached.expiry && (cacheExpiry < 0 || cached.expiry > Date.now());
83
83
  if (unexpired && cached.modified) {
84
84
  const value = fetch(request, cached.value);
85
- cache[cacheKey] = {
85
+ cache[cacheKey] = Object.create({
86
86
  value: {
87
87
  ...cached.value,
88
88
  ...value
89
89
  },
90
90
  expiry: cached.expiry
91
- };
91
+ });
92
92
  return cache[cacheKey];
93
93
  }
94
94
  if (unexpired) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/util",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.1",
4
4
  "description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)",
5
5
  "type": "module",
6
6
  "engines": {
@@ -61,11 +61,11 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-ssm": "^3.0.0",
64
- "@middy/core": "4.0.0-alpha.4",
64
+ "@middy/core": "4.0.1",
65
65
  "@types/aws-lambda": "^8.10.76",
66
66
  "@types/node": "^18.0.0",
67
67
  "aws-xray-sdk": "^3.3.3"
68
68
  },
69
69
  "homepage": "https://middy.js.org",
70
- "gitHead": "cbf2af8e31dab58ed28d26143cd77cca544657ae"
70
+ "gitHead": "c5ece2bfbb0d607dcdea5685bf194a6cc19acc8d"
71
71
  }