/** * Pilot * @author Tevin */ export class Pilot { constructor() { } $data() { return {}; } createOptions() { const options = { methods: {}, }; Object.getOwnPropertyNames(Object.getPrototypeOf(this)).forEach(name => { if (name === 'constructor' || name === '$methods') { return; } if (/^\$/.test(name)) { options[name.replace('$', '')] = this[name]; } else { options.methods[name] = this[name]; } }); return options; } }