Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

28
spa/node_modules/get-port/index.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
'use strict';
const net = require('net');
const getPort = options => new Promise((resolve, reject) => {
// For backwards compatibility with number-only input
// TODO: Remove this in the next major version
if (typeof options === 'number') {
options = {
port: options
};
}
const server = net.createServer();
server.unref();
server.on('error', reject);
server.listen(options, () => {
const port = server.address().port;
server.close(() => {
resolve(port);
});
});
});
module.exports = options => options ?
getPort(options).catch(() => getPort(0)) :
getPort(0);