Sha256: 366d76db0d80e427626cc0f685fd8295aba7fb6f5d517c32a96283d50e537fd0

Contents?: true

Size: 514 Bytes

Versions: 6

Compression:

Stored size: 514 Bytes

Contents

const AbstractHandler = require("./AbstractHandler");

class GetTypeHandler extends AbstractHandler {
    constructor() {
        super()
    }

    process(command) {
        const { payload } = command
        let typeName = payload[0]
        typeName = typeName.replace(".js", "")
        let type = global[typeName]
        if (type == undefined) {
            throw `Cannot load ${typeName}`
        }
        else { 
            return type
        }

        
    }
}

module.exports = new GetTypeHandler()

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/GetTypeHandler.js
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/GetTypeHandler.js
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/src/core/handler/GetTypeHandler.js
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/src/core/handler/GetTypeHandler.js
javonet-ruby-sdk-2.0.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/src/core/handler/GetTypeHandler.js
javonet-ruby-sdk-2.0.0 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/src/core/handler/GetTypeHandler.js