Przeglądaj źródła

Update sleep function to a conventional function, and lint.

Jason Grout 4 lat temu
rodzic
commit
e6bcef0b02
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      buildutils/src/publish.ts

+ 8 - 2
buildutils/src/publish.ts

@@ -10,7 +10,9 @@ import * as path from 'path';
 import { handlePackage } from './update-dist-tag';
 import * as utils from './utils';
 
-const sleep = (wait: number) => new Promise(resolve => setTimeout(resolve, wait));
+async function sleep(wait: number): Promise<void> {
+  return new Promise(resolve => setTimeout(resolve, wait));
+}
 
 // Specify the program signature.
 commander
@@ -57,7 +59,11 @@ commander
 
     // Pause to allow npm some time to update their servers to list the published packages.
     const pause = 10000;
-    console.log(`Pausing ${pause/1000} seconds after publishing to allow npmjs.com to update their package listing.`)
+    console.log(
+      `Pausing ${
+        pause / 1000
+      } seconds after publishing to allow npmjs.com to update their package listing.`
+    );
     await sleep(pause);
 
     // Update core mode.  This cannot be done until the JS packages are