Sha256: 97b8d02d77380e7267d9021aabbe1430c4660b71f3ff8886403bf8b4070eae2f
Contents?: true
Size: 896 Bytes
Versions: 6
Compression:
Stored size: 896 Bytes
Contents
const AbstractHandler = require("./AbstractHandler"); class GetStaticFieldHandler extends AbstractHandler { constructor() { super() } requiredParametersCount = 2 process(command) { try { if (command.payload.length < this.requiredParametersCount) { throw new Error("Array Static Field parameters mismatch") } const {payload} = command let type = payload[0] let field = payload[1] let staticField = type[field] if (typeof(staticField) === 'undefined') { throw new Error("Static field does not exist") } else { return staticField } } catch (error) { throw this.process_stack_trace(error, this.constructor.name) } } } module.exports = new GetStaticFieldHandler()
Version data entries
6 entries across 3 versions & 1 rubygems