UNPKG

@obstinado/gpx-builder

Version:
36 lines (32 loc) 526 B
class Person { /** * @see http://www.topografix.com/gpx/1/1/#type_personType */ constructor({ name, email, link }) { this.name = name || null; this.email = email || null; this.link = link || null; } toObject() { const { name, email, link } = this; return { ...(name ? { name } : {}), ...(email ? { email } : {}), ...(link ? { link: link.toObject() } : {}) }; } } export { Person as default };