keyv 4.5.3 → 4.5.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.
- package/package.json +4 -4
- package/src/index.js +6 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keyv",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.4",
|
|
4
4
|
"description": "Simple key-value storage with support for multiple backends",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@keyv/test-suite": "*",
|
|
44
|
-
"eslint": "^8.
|
|
44
|
+
"eslint": "^8.51.0",
|
|
45
45
|
"eslint-plugin-promise": "^6.1.1",
|
|
46
46
|
"pify": "^5.0.0",
|
|
47
|
-
"timekeeper": "^2.
|
|
48
|
-
"tsd": "^0.
|
|
47
|
+
"timekeeper": "^2.3.1",
|
|
48
|
+
"tsd": "^0.29.0"
|
|
49
49
|
},
|
|
50
50
|
"tsd": {
|
|
51
51
|
"directory": "test"
|
package/src/index.js
CHANGED
|
@@ -153,27 +153,22 @@ class Keyv extends EventEmitter {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (isArray) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
for (let row of data) {
|
|
156
|
+
return data.map((row, index) => {
|
|
159
157
|
if ((typeof row === 'string')) {
|
|
160
158
|
row = this.opts.deserialize(row);
|
|
161
159
|
}
|
|
162
160
|
|
|
163
161
|
if (row === undefined || row === null) {
|
|
164
|
-
|
|
165
|
-
continue;
|
|
162
|
+
return undefined;
|
|
166
163
|
}
|
|
167
164
|
|
|
168
165
|
if (typeof row.expires === 'number' && Date.now() > row.expires) {
|
|
169
|
-
this.delete(key).then(() => undefined);
|
|
170
|
-
|
|
171
|
-
} else {
|
|
172
|
-
result.push((options && options.raw) ? row : row.value);
|
|
166
|
+
this.delete(key[index]).then(() => undefined);
|
|
167
|
+
return undefined;
|
|
173
168
|
}
|
|
174
|
-
}
|
|
175
169
|
|
|
176
|
-
|
|
170
|
+
return (options && options.raw) ? row : row.value;
|
|
171
|
+
});
|
|
177
172
|
}
|
|
178
173
|
|
|
179
174
|
if (typeof data.expires === 'number' && Date.now() > data.expires) {
|