Use direct params instead of rest params

This commit is contained in:
Kevin Sawicki 2016-03-21 09:50:11 -07:00
parent 4f4dc2f4d8
commit 43746727aa
3 changed files with 9 additions and 11 deletions

View file

@ -51,11 +51,11 @@ var indexOfItemById = function(items, id) {
// Returns the index of where to insert the item according to |position|.
var indexToInsertByPosition = function(items, position) {
var id, insertIndex, query, ref1;
var insertIndex;
if (!position) {
return items.length;
}
ref1 = position.split('='), query = ref1[0], id = ref1[1];
const [query, id] = position.split('=');
insertIndex = indexOfItemById(items, id);
if (insertIndex === -1 && query !== 'endof') {
console.warn("Item with id '" + id + "' is not found");