Skip to content

Instantly share code, notes, and snippets.

@randallb
Created July 29, 2014 18:40
Show Gist options
  • Save randallb/aa29e352e2c508528510 to your computer and use it in GitHub Desktop.
Save randallb/aa29e352e2c508528510 to your computer and use it in GitHub Desktop.
processCells: (cells) =>
for cell in cells
@[cell.attributes.attribute.id] = {} if !@[cell.attributes.attribute.id]?
@[cell.attributes.attribute.id][cell.attributes.attribute.value] = {} if !@[cell.attributes.attribute.id][cell.attributes.attribute.value]?
if _.isNaN(cell.value / 1) && cell.value
@[cell.attributes.attribute.id][cell.attributes.attribute.value].name = cell.value unless @[cell.attributes.attribute.id][cell.attributes.attribute.value].name?
else if cell.value
@[cell.attributes.attribute.id][cell.attributes.attribute.value].value = cell.value / 1 unless @[cell.attributes.attribute.id][cell.attributes.attribute.value].value?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment