UNPKG

ws-rmi

Version:

A Remote Method Invocation implementation written in JavaScript utilising the WebSocket protocol

15 lines (14 loc) 730 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateRMIRemoteResponse = void 0; const JSONValidation_1 = require("../JSONValidation"); const Utils_1 = require("../Utils"); const RMIRemoteResult_1 = require("./RMIRemoteResult"); const RMIRemoteError_1 = require("./RMIRemoteError"); /** * Validates that the given response is an RMI Remote Response. * * @param response The response to validate. */ const validateRMIRemoteResponse = (response) => (0, JSONValidation_1.isObject)(response) && (0, Utils_1.xor)((0, RMIRemoteResult_1.validateRMIRemoteResult)(response), (0, RMIRemoteError_1.validateRMIRemoteError)(response)); exports.validateRMIRemoteResponse = validateRMIRemoteResponse;