Consider all object params as keys if none exists
This commit is contained in:
1 parent
7fdd04343b
commit
4d255acfc6
1 file changed
+7
@@ -100,6 +100,13 @@ function refresh(callback) {
|
||||
return counter = 0;
|
||||
}
|
||||
|
||||
// If no keys are defined, consider all parameters as keys to keep the
|
||||
// same behavior from v1.0
|
||||
for (let obj of objects) {
|
||||
if (!obj["_keys"] || !obj["_keys"].length)
|
||||
obj["_keys"] = Object.keys(obj).filter(k => !k.startsWith("_"));
|
||||
}
|
||||
|
||||
res.sort((a, b) => {
|
||||
if (a.weight === b.weight)
|
||||
return a._id > b._id;
|
||||
|
||||
Reference in new issue
Block a user