Skip to content

Make Readtable Object based vs Array based #7

Description

@gabejohnson

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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions