File: use-source-map-js.patch

package info (click to toggle)
node-recast 0.23.4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,340 kB
  • sloc: javascript: 938; sh: 22; makefile: 4
file content (44 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Use source-map-js instead of source-map
 source-map >= 0.7 has an async API which is incompatible.
 source-map-js is a synchronous fork of source-map 0.6.
Forwarded: not-needed
--- a/lib/lines.ts
+++ b/lib/lines.ts
@@ -1,5 +1,5 @@
 import assert from "assert";
-import sourceMap from "source-map";
+import sourceMap from "source-map-js";
 import { normalize as normalizeOptions, Options } from "./options";
 import { namedTypes } from "ast-types";
 import { comparePos } from "./util";
--- a/lib/util.ts
+++ b/lib/util.ts
@@ -1,7 +1,7 @@
 import assert from "assert";
 import * as types from "ast-types";
 const n = types.namedTypes;
-import sourceMap from "source-map";
+import sourceMap from "source-map-js";
 const SourceMapConsumer = sourceMap.SourceMapConsumer;
 const SourceMapGenerator = sourceMap.SourceMapGenerator;
 const hasOwn = Object.prototype.hasOwnProperty;
@@ -67,8 +67,8 @@
 
   smcLatter.eachMapping(function (mapping) {
     const origPos = smcFormer.originalPositionFor({
-      line: mapping.originalLine,
-      column: mapping.originalColumn,
+      line: mapping.originalLine as number,
+      column: mapping.originalColumn as number,
     });
 
     const sourceName = origPos.source;
--- a/test/mapping.ts
+++ b/test/mapping.ts
@@ -1,5 +1,5 @@
 import assert from "assert";
-import sourceMap from "source-map";
+import sourceMap from "source-map-js";
 import * as recast from "../main";
 import * as types from "ast-types";
 const n = types.namedTypes;