build/component-docs-build.js
function eventsAPIObject(vueObj) {
  const eventsObj = vueObj["events"] || {}
  let events = []

  for (const evt in eventsObj) {
    if (eventsObj.hasOwnProperty(evt)) {
      const ele = {
        "name": `${evt}`,
        "type": `${eventsObj[evt]["type"]["names"].reduce((typeList, type, idx, arr) => {
          typeList += `${type}${arr[idx+1] ? `|` : ''}`
          return typeList
        }, '')}`,
        "description": `${eventsObj[evt]["description"] || 'MISSING DESCRIPTION'}`
      }
      events.push(ele)
    }
  }
  return events.length > 0 ? {events} : null
}
function eventsAPIObject(vueObj) {
  const eventsObj = vueObj["events"] || {}
  let events = []

  for (const evt in eventsObj) {
    if (eventsObj.hasOwnProperty(evt)) {
      const ele = {
        "name": `${evt}`,
        "type": `${eventsObj[evt]["type"]["names"].reduce((typeList, type, idx, arr) => {
          typeList += `${type}${arr[idx+1] ? `|` : ''}`
          return typeList
        }, '')}`,
        "description": `${eventsObj[evt]["description"] || 'MISSING DESCRIPTION'}`
      }
      events.push(ele)
    }
  }
  return events.length > 0 ? {events} : null
}
function eventsAPIObject ( vueObj ) { const eventsObj = vueObj [ "events" ] || { } let events = [ ] for ( const evt in eventsObj ) { if ( eventsObj . hasOwnProperty ( evt ) ) { const ele = { "name" : ` ${ evt } ` , "type" : ` ${ eventsObj [ evt ] [ "type" ] [ "names" ] . reduce ( ( typeList , type , idx , arr ) => { typeList += ` ${ type } ${ arr [ idx + 1 ] ? ` ` : '' } ` return typeList } , '' ) } ` , "description" : ` ${ eventsObj [ evt ] [ "description" ] || 'MISSING DESCRIPTION' } ` } events . push ( ele ) } } return events . length > 0 ? { events } : null }
Create object representing component events
@param {Object} -- JSON object from vue-docgen-api library
@returns {Object} -- Object for component events that goes into Cedar Data Object
Create object representing component events