UNPKG

@obstinado/gpx-builder

Version:
38 lines (33 loc) 536 B
'use strict'; 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() } : {}) }; } } module.exports = Person;