File: fix-ansi-colors-compatibility-Promise-issue.patch

package info (click to toggle)
node-gulp-tsb 4.0.5%2B~cs7.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 496 kB
  • sloc: javascript: 928; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 1,934 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description: This patch is made for the following reasons:
 * The upstream author uses a old version of ansi-colors. But debian
   contains the new version of this package.
 * Old ansi-colors uses bgcyan for outputting the message whereas new
   ansi-colors uses bgCyan. For avoiding warning about this, I've been
   updated src/builder.ts and lib/builder.js files.
 * Added <void> in a Promise code of src/builder.ts for avoiding warning about that.

--- a/lib/builder.js
+++ b/lib/builder.js
@@ -281,7 +281,7 @@
             if (config.verbose) {
                 const headNow = process.memoryUsage().heapUsed;
                 const MB = 1024 * 1024;
-                log('[tsb]', 'time:', colors.yellow((Date.now() - t1) + 'ms'), 'mem:', colors.cyan(Math.ceil(headNow / MB) + 'MB'), colors.bgcyan('Δ' + Math.ceil((headNow - headUsed) / MB)));
+                log('[tsb]', 'time:', colors.yellow((Date.now() - t1) + 'ms'), 'mem:', colors.cyan(Math.ceil(headNow / MB) + 'MB'), colors.bgCyan('Δ' + Math.ceil((headNow - headUsed) / MB)));
                 headUsed = headNow;
             }
         });
--- a/src/builder.ts
+++ b/src/builder.ts
@@ -198,7 +198,7 @@
             }
         }
 
-        return new Promise(resolve => {
+        return new Promise<void>(resolve => {
 
             let semanticCheckInfo = new Map<string, number>();
             let seenAsDependentFile = new Set<string>();
@@ -357,7 +357,7 @@
                 const MB = 1024 * 1024;
                 log('[tsb]',
                     'time:', colors.yellow((Date.now() - t1) + 'ms'),
-                    'mem:', colors.cyan(Math.ceil(headNow / MB) + 'MB'), colors.bgcyan('Δ' + Math.ceil((headNow - headUsed) / MB))
+                    'mem:', colors.cyan(Math.ceil(headNow / MB) + 'MB'), colors.bgCyan('Δ' + Math.ceil((headNow - headUsed) / MB))
                 );
                 headUsed = headNow;
             }