Sha256: 68888ce99afe4881af9620a2941229634f4c9b9cbf8f65f064d70989275b940d
Contents?: true
Size: 1.03 KB
Versions: 19
Compression:
Stored size: 1.03 KB
Contents
const AbstractHandler = require("./AbstractHandler"); const TypeCache = require("../typeCache/TypeCache"); class EnableTypeHandler extends AbstractHandler { requiredParametersCount = 1 constructor() { super() } process(command) { try { if (command.payload.length < this.requiredParametersCount) { throw new Error("Get Type parameters mismatch") } const typeCache = new TypeCache(); for (let payload of command.payload) { if (typeof payload === 'string') { typeCache.cacheType(payload); } if (Array.isArray(payload)) { for (let namespace_to_enable of payload) { typeCache.cacheType(namespace_to_enable); } } } return 0; } catch (error) { throw this.process_stack_trace(error, this.constructor.name) } } } module.exports = new EnableTypeHandler()
Version data entries
19 entries across 14 versions & 1 rubygems