metro-source-map 0.71.2 → 0.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro-source-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.1",
|
|
4
4
|
"description": "🚇 Source map generator for Metro.",
|
|
5
5
|
"main": "src/source-map.js",
|
|
6
6
|
"repository": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"@babel/traverse": "^7.14.0",
|
|
16
16
|
"@babel/types": "^7.0.0",
|
|
17
17
|
"invariant": "^2.2.4",
|
|
18
|
-
"metro-symbolicate": "0.
|
|
18
|
+
"metro-symbolicate": "0.72.1",
|
|
19
19
|
"nullthrows": "^1.1.1",
|
|
20
|
-
"ob1": "0.
|
|
20
|
+
"ob1": "0.72.1",
|
|
21
21
|
"source-map": "^0.5.6",
|
|
22
22
|
"vlq": "^1.0.0"
|
|
23
23
|
},
|
|
@@ -43,7 +43,7 @@ class AbstractConsumer implements IConsumer {
|
|
|
43
43
|
callback: (mapping: Mapping) => mixed,
|
|
44
44
|
context?: mixed = null,
|
|
45
45
|
order?: IterationOrder = GENERATED_ORDER,
|
|
46
|
-
) {
|
|
46
|
+
): void {
|
|
47
47
|
invariant(
|
|
48
48
|
order === GENERATED_ORDER,
|
|
49
49
|
`Iteration order not implemented: ${iterationOrderToString(order)}`,
|
|
@@ -91,7 +91,7 @@ class MappingsConsumer extends AbstractConsumer implements IConsumer {
|
|
|
91
91
|
return {...EMPTY_POSITION};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
*_decodeMappings() {
|
|
94
|
+
*_decodeMappings(): Generator<Mapping, void, void> {
|
|
95
95
|
let generatedLine = FIRST_LINE;
|
|
96
96
|
let generatedColumn = FIRST_COLUMN;
|
|
97
97
|
let originalLine = FIRST_LINE;
|
package/src/encode.js.flow
CHANGED
|
@@ -88,7 +88,7 @@ const VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
|
88
88
|
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
|
89
89
|
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
|
90
90
|
*/
|
|
91
|
-
function toVLQSigned(value) {
|
|
91
|
+
function toVLQSigned(value: number) {
|
|
92
92
|
return value < 0 ? (-value << 1) + 1 : (value << 1) + 0;
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -152,7 +152,7 @@ function getNameForPath(path) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
let propertyPath;
|
|
155
|
-
let kind
|
|
155
|
+
let kind; // Find or construct an AST node that names the current node.
|
|
156
156
|
|
|
157
157
|
if ((0, _types.isObjectMethod)(node) || (0, _types.isClassMethod)(node)) {
|
|
158
158
|
// ({ foo() {} });
|
|
@@ -264,7 +264,7 @@ function getNameForPath(path) {
|
|
|
264
264
|
return ANONYMOUS_NAME;
|
|
265
265
|
} // Annotate getters and setters.
|
|
266
266
|
|
|
267
|
-
if (kind) {
|
|
267
|
+
if (kind != null) {
|
|
268
268
|
name = kind + "__" + name;
|
|
269
269
|
} // Annotate members with the name of their containing object/class.
|
|
270
270
|
|
|
@@ -54,7 +54,7 @@ type RangeMapping = {
|
|
|
54
54
|
start: Position,
|
|
55
55
|
...
|
|
56
56
|
};
|
|
57
|
-
type Context = {filename?: string, ...};
|
|
57
|
+
export type Context = {filename?: string, ...};
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Generate a map of source positions to function names. The names are meant to
|
|
@@ -190,8 +190,7 @@ function getNameForPath(path: NodePath<>): string {
|
|
|
190
190
|
return node.id.name;
|
|
191
191
|
}
|
|
192
192
|
let propertyPath;
|
|
193
|
-
let kind: ?
|
|
194
|
-
'';
|
|
193
|
+
let kind: ?string;
|
|
195
194
|
|
|
196
195
|
// Find or construct an AST node that names the current node.
|
|
197
196
|
if (isObjectMethod(node) || isClassMethod(node)) {
|
|
@@ -276,7 +275,7 @@ function getNameForPath(path: NodePath<>): string {
|
|
|
276
275
|
}
|
|
277
276
|
|
|
278
277
|
// Annotate getters and setters.
|
|
279
|
-
if (kind) {
|
|
278
|
+
if (kind != null) {
|
|
280
279
|
name = kind + '__' + name;
|
|
281
280
|
}
|
|
282
281
|
|
|
@@ -512,12 +511,7 @@ class RelativeValue {
|
|
|
512
511
|
}
|
|
513
512
|
}
|
|
514
513
|
|
|
515
|
-
function positionGreater(
|
|
516
|
-
x: {column: number, line: number},
|
|
517
|
-
y:
|
|
518
|
-
| {column: number, line: number}
|
|
519
|
-
| $TEMPORARY$object<{column: number, line: number}>,
|
|
520
|
-
) {
|
|
514
|
+
function positionGreater(x: Position, y: Position) {
|
|
521
515
|
return x.line > y.line || (x.line === y.line && x.column > y.column);
|
|
522
516
|
}
|
|
523
517
|
|