src/template.js
function toJS(entity) {
  let data = {};
  Object.keys(entity).forEach(key => {
    if (_.some(customObjects, obj => entity[key] instanceof obj)) {
      data[key] = toJS(entity[key])
    } else {
      data[key] = entity[key]
    }
  });
  return data
}
function toJS(entity) {
  let data = {};
  Object.keys(entity).forEach(key => {
    if (_.some(customObjects, obj => entity[key] instanceof obj)) {
      data[key] = toJS(entity[key])
    } else {
      data[key] = entity[key]
    }
  });
  return data
}
function toJS ( entity ) { let data = { } ; Object . keys ( entity ) . forEach ( key => { if ( _ . some ( customObjects , obj => entity [ key ] instanceof obj ) ) { data [ key ] = toJS ( entity [ key ] ) } else { data [ key ] = entity [ key ] } } ) ; return data }
Convert contents of entity into generic JS object that can be parsed by immutable
@param entity
@returns object
Convert contents of entity into generic JS object that can be parsed by immutable