@jsenv/core 27.3.1 → 27.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -2654,6 +2654,22 @@ const statusIsClientError = status => status >= 400 && status < 500;
2654
2654
 
2655
2655
  const statusIsServerError = status => status >= 500 && status < 600;
2656
2656
 
2657
+ const applyDnsResolution = async hostname => {
2658
+ const dnsResolution = await new Promise((resolve, reject) => {
2659
+ lookup(hostname, (error, address, family) => {
2660
+ if (error) {
2661
+ reject(error);
2662
+ } else {
2663
+ resolve({
2664
+ address,
2665
+ family
2666
+ });
2667
+ }
2668
+ });
2669
+ });
2670
+ return dnsResolution;
2671
+ };
2672
+
2657
2673
  const getServerOrigins = async ({
2658
2674
  protocol,
2659
2675
  ip,
@@ -2684,22 +2700,6 @@ const getServerOrigins = async ({
2684
2700
  };
2685
2701
  };
2686
2702
 
2687
- const applyDnsResolution = async hostname => {
2688
- const dnsResolution = await new Promise((resolve, reject) => {
2689
- lookup(hostname, (error, address, family) => {
2690
- if (error) {
2691
- reject(error);
2692
- } else {
2693
- resolve({
2694
- address,
2695
- family
2696
- });
2697
- }
2698
- });
2699
- });
2700
- return dnsResolution;
2701
- };
2702
-
2703
2703
  const createServerOrigin = ({
2704
2704
  protocol,
2705
2705
  hostname,
@@ -26795,6 +26795,13 @@ nodeWorkerThread.run = async ({
26795
26795
  onceWorkerThreadMessage(workerThread, "ready", resolve);
26796
26796
  });
26797
26797
  const stop = memoize(async () => {
26798
+ // read all stdout before terminating
26799
+ // (no need for stderr because it's sync)
26800
+ while (workerThread.stdout.read() !== null) {}
26801
+
26802
+ await new Promise(resolve => {
26803
+ setTimeout(resolve);
26804
+ });
26798
26805
  await workerThread.terminate();
26799
26806
  });
26800
26807
  const winnerPromise = new Promise(resolve => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "27.3.1",
3
+ "version": "27.3.2",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -102,6 +102,12 @@ nodeWorkerThread.run = async ({
102
102
  })
103
103
 
104
104
  const stop = memoize(async () => {
105
+ // read all stdout before terminating
106
+ // (no need for stderr because it's sync)
107
+ while (workerThread.stdout.read() !== null) {}
108
+ await new Promise((resolve) => {
109
+ setTimeout(resolve)
110
+ })
105
111
  await workerThread.terminate()
106
112
  })
107
113