MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / transformToValidPort

Function transformToValidPort

e2e/fixtures/utils.js:5–11  ·  view source on GitHub ↗
(defaultPort, pid)

Source from the content-addressed store, hash-verified

3import { DEFAULT_DAPP_SERVER_PORT } from './fixture-helper';
4
5function transformToValidPort(defaultPort, pid) {
6 // Improve uniqueness by using a simple transformation
7 const transformedPort = (parseInt(pid, 10) % 100000) + defaultPort;
8
9 // Ensure the transformed port falls within the valid port range (0-65535)
10 return transformedPort % 65536;
11}
12
13function getServerPort(defaultPort) {
14 if (process.env.CI) {

Callers 1

getServerPortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected