UNPKG

moy-dom

Version:

A flexiable Virtual DOM library for building modern web interface.

19 lines (17 loc) 331 B
export default function makeKeyIndexAndFree(list){ const keyIndex = new Map(), free = [] let itemKey for(let [index, item] of list.entries()){ itemKey = item.key if(itemKey !== undefined){ keyIndex.set(itemKey, index) }else{ free.push(item) } } return { keyIndex, free, } }