gpx-builder
Version:
Builder of GPX files
35 lines (33 loc) • 506 B
JavaScript
class Person {
/**
* @see http://www.topografix.com/gpx/1/1/#type_personType
*/
constructor({
name,
email,
link
}) {
this.name = name;
this.email = email;
this.link = link;
}
toObject() {
const {
name,
email,
link
} = this;
return {
...(name ? {
name
} : {}),
...(email ? {
email
} : {}),
...(link ? {
link: link.toObject()
} : {})
};
}
}
export { Person as default };