UNPKG

xkite-core

Version:
18 lines (17 loc) 604 B
import * as consts from './constants/yml.js'; const { _ports_ } = consts; import { portNumbers } from './deps.bundle.js'; const getPorts = require('./deps.bundle.js').default; export function getDefaultPorts(type, count) { return _ports_; } export default async function getAvailablePorts(firstPort, count) { const availablePorts = []; const maxPort = firstPort + 200; for (count; count > 0; count--) { const newPort = await getPorts({ port: portNumbers(firstPort, maxPort) }); firstPort = newPort; availablePorts.push(newPort); } return availablePorts; }