UNPKG

@obstinado/gpx-builder

Version:
41 lines (36 loc) 650 B
'use strict'; class Copyright { /** * @param author - Owner of licence * @param year - Year of licence * @param license - Type of licence * @see http://www.topografix.com/gpx/1/1/#type_copyrightType */ constructor(author, { year, license }) { this.author = author; this.year = year || null; this.license = license || null; } toObject() { const { author, year, license } = this; return { attributes: { author }, ...(year ? { year } : {}), ...(license ? { license } : {}) }; } } module.exports = Copyright;