Skip to content

Commit 1cece40

Browse files
committed
update deps, update lockfile version, add new version of node to tests
1 parent 021aa6b commit 1cece40

File tree

5 files changed

+2482
-4252
lines changed

5 files changed

+2482
-4252
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [16.x, 18.x]
18+
node-version: [18, 20, 22]
19+
architecture-type: [x64, arm64]
1920

2021
steps:
21-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4.1.7
2223
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4.0.3
2425
with:
2526
node-version: ${{ matrix.node-version }}
27+
architecture: ${{ matrix.architecture-type }}
2628
cache: 'npm'
2729
- name: Install dependencies
2830
run: npm ci

cjs/index.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
1717
return to;
1818
};
1919
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20+
// If the importer is in node compatibility mode or this is not an ESM
21+
// file that has been converted to a CommonJS file using a Babel-
22+
// compatible transform (i.e. "__esModule" has not been set), then set
23+
// "default" to the CommonJS "module.exports" for node compatibility.
2024
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
2125
mod
2226
));
@@ -77,15 +81,13 @@ function* getEndpoints(argument, defaultPorts = DEFAULT_PORTS) {
7781
if (!Array.isArray(ports) || ports.length === 0) {
7882
ports = defaultPortList;
7983
}
80-
if (!host || ports.length === 0)
81-
return;
84+
if (!host || ports.length === 0) return;
8285
for (const portChunk of ports) {
8386
if (portChunk.includes("-")) {
8487
let [fromPort, toPort] = portChunk.split("-");
8588
fromPort = Math.max(1, Math.abs(parseInt(fromPort, 10)));
8689
toPort = Math.min(65535, Math.abs(parseInt(toPort, 10)));
87-
if (isNaN(fromPort) || isNaN(toPort))
88-
continue;
90+
if (isNaN(fromPort) || isNaN(toPort)) continue;
8991
if (fromPort > toPort) {
9092
[fromPort, toPort] = [toPort, fromPort];
9193
}
@@ -101,8 +103,7 @@ function* getEndpoints(argument, defaultPorts = DEFAULT_PORTS) {
101103

102104
// src/one.js
103105
var handleFail = (resolve, socket) => {
104-
if (socket && !socket.destroyed)
105-
socket.destroy();
106+
if (socket && !socket.destroyed) socket.destroy();
106107
resolve(false);
107108
};
108109
var handleSuccess = (resolve, socket) => {
@@ -162,8 +163,7 @@ async function* tcpExistsMany(endpoints, options) {
162163
const chunk = [];
163164
for (const item of getEndpoints(endpoints, DEFAULT_PORTS)) {
164165
if (chunk.push(item) === DEFAULT_CHUNK_SIZE) {
165-
if ((signal == null ? void 0 : signal.aborted) === true)
166-
return;
166+
if ((signal == null ? void 0 : signal.aborted) === true) return;
167167
yield await chunk_default(chunk, {
168168
timeout,
169169
returnOnlyExisted,
@@ -172,8 +172,7 @@ async function* tcpExistsMany(endpoints, options) {
172172
chunk.length = 0;
173173
}
174174
}
175-
if ((signal == null ? void 0 : signal.aborted) === true)
176-
return;
175+
if ((signal == null ? void 0 : signal.aborted) === true) return;
177176
yield await chunk_default(chunk, { timeout, returnOnlyExisted, signal });
178177
chunk.length = 0;
179178
}

0 commit comments

Comments
 (0)