UNPKG

xiot-core-spec-ts

Version:
18 lines (17 loc) 548 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const AgentMapping_1 = require("../../typedef/agent/AgentMapping"); class AgentMappingCodec { static encode(mapping) { return { remotePort: mapping.remotePort, localPort: mapping.localPort }; } static decode(o) { const remotePort = o.remotePort; const localPort = o.localPort; return new AgentMapping_1.AgentMapping(remotePort, localPort); } } exports.AgentMappingCodec = AgentMappingCodec;