Package: node-babel / 6.26.0+dfsg-3

remove-trim-right.patch Patch series | download
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
--- a/packages/babel-generator/package.json
+++ b/packages/babel-generator/package.json
@@ -17,8 +17,7 @@
     "detect-indent": "^4.0.0",
     "jsesc": "^1.3.0",
     "lodash": "^4.17.4",
-    "source-map": "^0.5.6",
-    "trim-right": "^1.0.1"
+    "source-map": "^0.5.6"
   },
   "devDependencies": {
     "babel-helper-fixtures": "^6.26.0",
--- a/packages/babel-generator/src/buffer.js
+++ b/packages/babel-generator/src/buffer.js
@@ -1,5 +1,4 @@
 import type SourceMap from "./source-map";
-import trimRight from "trim-right";
 
 const SPACES_RE = /^[ \t]+$/;
 
@@ -42,7 +41,7 @@
     const result = {
       // Whatever trim is used here should not execute a regex against the
       // source string since it may be arbitrarily large after all transformations
-      code: trimRight(this._buf.join("")),
+      code: this._buf.join("").replace(/\s+$/,''),
       map: null,
       rawMappings: map && map.getRawMappings(),
     };