const logger = require('./logger')() // Pulls all functions from a class and sends output to 'controller.js' class Methods { constructor() { this.removeMethods = [ 'scripts', 'constructor', '__defineGetter__', '__defineSetter__', 'hasOwnProperty', '__lookupGetter__', '__lookupSetter__', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'valueOf', '__proto__', 'toLocaleString' ] } GetMethods(x) { try { this.object = { class: x, props: [], methods: new Map() } do {this.object.props = this.object.props.concat(Object.getOwnPropertyNames(x))} while (x = Object.getPrototypeOf(x)) this.object.props.filter((prop) => {this.object.methods.set(prop, this.object.class[prop])}) this.int = 0 for (const [key, value] of this.object.methods.entries()) { if (this.object.methods.has(this.removeMethods[this.int])) {this.object.methods.delete(this.removeMethods[this.int])} this.int++ } return this.object.methods } catch (err) { logger.Error(err) return false } } } module.exports = () => {return new Methods}