Currently the readtable is implemented using an Array and keys are converted to numbers as entries are added. Another option would be it convert numbers into strings and use those strings as property names in a POJO.
Then extending could be:
function extendTable(table, extension) {
const descriptor = Object.keys(extension).reduce((desc, k) => (desc[k] = {
mode: { value: extension[k].mode },
action: { value: extension[k].action }
}, desc));
return Object.create(table, descriptor);
}
Currently the readtable is implemented using an
Arrayand keys are converted to numbers as entries are added. Another option would be it convert numbers into strings and use those strings as property names in a POJO.Then extending could be: