We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e7030e commit 435b12cCopy full SHA for 435b12c
index.js
@@ -27,13 +27,13 @@ module.exports = {
27
// Get all values starting with a certain pathname and filter their views
28
getAll: async function getAll(options) {
29
const data = {}
30
- const keys = await module.exports.keys()
+ const keys = (await module.exports.keys()).filter(key => key.startsWith(options.pathname))
31
32
- keys
33
- .filter(key => key.startsWith(options.pathname))
34
- .forEach((key) => {
35
- data[key] = module.exports.get(key, { before: options.before, after: options.after })
36
- })
+ for (let key of keys) {
+ data[key] = await module.exports.get(key, { before: options.before, after: options.after })
+ }
+
+ await Promise.all(keys)
37
38
return data
39
}
0 commit comments