UNPKG

@arifwidianto/rpc-agent

Version:

RPC Agent for both client and server, extends more methods easily

30 lines 925 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class NetworkExtension { name = "network"; status = "active"; config = { enabled: true }; metadata = { name: this.name, version: "1.0.0", description: "Network utilities extension", }; methods = { validatePort: async (params) => { const { port, type } = params; if (!Number.isInteger(port)) { throw new Error(`Invalid ${type} port: ${port}. Port must be an integer.`); } if (port < 1 || port > 65535) { throw new Error(`Invalid ${type} port: ${port}. Port must be between 1 and 65535.`); } return { valid: true, port: port, type: type, }; }, }; } exports.default = NetworkExtension; //# sourceMappingURL=index.js.map