You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like the findAttributesPattern function is not properly sorting the attributes by the priority array properly. Looks like the sort comparison check is not correct. changing the sort code to this below seemed to resolve the issue
var outsidePriority = priority.length + 1; // greater than any priority position
var sortedKeys = Object.keys(attributes).sort(function (curr, next) {
var currPos = priority.indexOf(attributes[curr].name);
var nextPos = priority.indexOf(attributes[next].name);
if (nextPos == -1) nextPos = outsidePriority;
if (currPos == -1) currPos = outsidePriority;
if (nextPos > currPos) { return -1;}
if (nextPos < currPos) { return 1;}
return 0;
/* old code
if (nextPos === -1) {
if (currPos === -1) {
return 0;
}
return -1;
}
return currPos - nextPos;
*/
});
The text was updated successfully, but these errors were encountered:
Looks like the findAttributesPattern function is not properly sorting the attributes by the priority array properly. Looks like the sort comparison check is not correct. changing the sort code to this below seemed to resolve the issue
var outsidePriority = priority.length + 1; // greater than any priority position
var sortedKeys = Object.keys(attributes).sort(function (curr, next) {
var currPos = priority.indexOf(attributes[curr].name);
var nextPos = priority.indexOf(attributes[next].name);
/* old code
if (nextPos === -1) {
if (currPos === -1) {
return 0;
}
return -1;
}
return currPos - nextPos;
*/
});
The text was updated successfully, but these errors were encountered: