File: fix-buffer-warnings.patch

package info (click to toggle)
node-inline-source-map 0.6.2~git-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 240 kB
  • sloc: makefile: 20; sh: 15
file content (44 lines) | stat: -rw-r--r-- 1,506 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
40
41
42
43
44
Subject: Fix warnings with newer node
author: Bastien Roucariès <rouca@debian.org>

forwarded: https://github.com/thlorenz/inline-source-map/issues/22

Index: node-inline-source-map/index.js
===================================================================
--- node-inline-source-map.orig/index.js
+++ node-inline-source-map/index.js
@@ -91,7 +91,7 @@ Generator.prototype.addSourceContent = f
  */
 Generator.prototype.base64Encode = function () {
   var map = this.toString();
-  return new Buffer(map).toString('base64');
+  return new Buffer.from(map).toString('base64');
 };
 
 /**
Index: node-inline-source-map/test/inline-source-map.js
===================================================================
--- node-inline-source-map.orig/test/inline-source-map.js
+++ node-inline-source-map/test/inline-source-map.js
@@ -15,7 +15,7 @@ var bar = '' + function bar () {
 }
 
 function decode(base64) {
-  return new Buffer(base64, 'base64').toString();
+  return new Buffer.from(base64, 'base64').toString();
 } 
 
 function inspect(obj, depth) {
Index: node-inline-source-map/test/source-content.js
===================================================================
--- node-inline-source-map.orig/test/source-content.js
+++ node-inline-source-map/test/source-content.js
@@ -15,7 +15,7 @@ var bar = '' + function bar () {
 }
 
 function decode(base64) {
-  return new Buffer(base64, 'base64').toString();
+  return new Buffer.from(base64, 'base64').toString();
 } 
 
 function inspect(obj, depth) {