1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.getFreePortAsync = getFreePortAsync;
|
7 | function _freeportAsync() {
|
8 | const data = _interopRequireDefault(require("freeport-async"));
|
9 | _freeportAsync = function () {
|
10 | return data;
|
11 | };
|
12 | return data;
|
13 | }
|
14 | function _internal() {
|
15 | const data = require("../internal");
|
16 | _internal = function () {
|
17 | return data;
|
18 | };
|
19 | return data;
|
20 | }
|
21 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
22 | async function getFreePortAsync(rangeStart) {
|
23 | const port = await (0, _freeportAsync().default)(rangeStart, {
|
24 | hostnames: [null, 'localhost']
|
25 | });
|
26 | if (!port) {
|
27 | throw new (_internal().XDLError)('NO_PORT_FOUND', 'No available port found');
|
28 | }
|
29 | return port;
|
30 | }
|
31 |
|
\ | No newline at end of file |