Sha256: f5ce72aa392baad9c4021ec764101158071f43396619624d15a963a4f0f50f26
Contents?: true
Size: 580 Bytes
Versions: 6
Compression:
Stored size: 580 Bytes
Contents
const AbstractHandler = require("./AbstractHandler"); class InvokeGlobalMethodHandler extends AbstractHandler { constructor() { super() } process(command) { const { payload } = command const splitted = payload[0].split(".") const args = payload.slice(1) let methodToInvoke for(let i = 0; i < splitted.length; i++) { methodToInvoke = !methodToInvoke ? global[splitted[i]] : methodToInvoke[splitted[i]] } return methodToInvoke(args) } } module.exports = new InvokeGlobalMethodHandler()
Version data entries
6 entries across 3 versions & 1 rubygems