metro-source-map 0.76.7 → 0.78.0
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 +4 -4
- package/src/source-map.js +17 -19
- package/src/source-map.js.flow +17 -21
- package/rn-babelrc.json +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro-source-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.0",
|
|
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.20.0",
|
|
16
16
|
"@babel/types": "^7.20.0",
|
|
17
17
|
"invariant": "^2.2.4",
|
|
18
|
-
"metro-symbolicate": "0.
|
|
18
|
+
"metro-symbolicate": "0.78.0",
|
|
19
19
|
"nullthrows": "^1.1.1",
|
|
20
|
-
"ob1": "0.
|
|
20
|
+
"ob1": "0.78.0",
|
|
21
21
|
"source-map": "^0.5.6",
|
|
22
22
|
"vlq": "^1.0.0"
|
|
23
23
|
},
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"terser": "^5.15.0"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=18"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/source-map.js
CHANGED
|
@@ -151,29 +151,27 @@ function addMappingsForFile(generator, mappings, module, carryOver) {
|
|
|
151
151
|
generator.endFile();
|
|
152
152
|
}
|
|
153
153
|
function addMapping(generator, mapping, carryOver) {
|
|
154
|
-
const n = mapping.length;
|
|
155
154
|
const line = mapping[0] + carryOver;
|
|
156
155
|
// lines start at 1, columns start at 0
|
|
157
156
|
const column = mapping[1];
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} else {
|
|
175
|
-
throw new Error(`Invalid mapping: [${mapping.join(", ")}]`);
|
|
157
|
+
switch (mapping.length) {
|
|
158
|
+
case 2:
|
|
159
|
+
generator.addSimpleMapping(line, column);
|
|
160
|
+
return;
|
|
161
|
+
case 4:
|
|
162
|
+
generator.addSourceMapping(line, column, mapping[2], mapping[3]);
|
|
163
|
+
return;
|
|
164
|
+
case 5:
|
|
165
|
+
generator.addNamedSourceMapping(
|
|
166
|
+
line,
|
|
167
|
+
column,
|
|
168
|
+
mapping[2],
|
|
169
|
+
mapping[3],
|
|
170
|
+
mapping[4]
|
|
171
|
+
);
|
|
172
|
+
return;
|
|
176
173
|
}
|
|
174
|
+
throw new Error(`Invalid mapping: [${mapping.join(", ")}]`);
|
|
177
175
|
}
|
|
178
176
|
const newline = /\r\n?|\n|\u2028|\u2029/g;
|
|
179
177
|
const countLines = (string) => (string.match(newline) || []).length + 1;
|
package/src/source-map.js.flow
CHANGED
|
@@ -301,31 +301,27 @@ function addMapping(
|
|
|
301
301
|
mapping: MetroSourceMapSegmentTuple,
|
|
302
302
|
carryOver: number,
|
|
303
303
|
) {
|
|
304
|
-
const n = mapping.length;
|
|
305
304
|
const line = mapping[0] + carryOver;
|
|
306
305
|
// lines start at 1, columns start at 0
|
|
307
306
|
const column = mapping[1];
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
sourceMap[4],
|
|
325
|
-
);
|
|
326
|
-
} else {
|
|
327
|
-
throw new Error(`Invalid mapping: [${mapping.join(', ')}]`);
|
|
307
|
+
switch (mapping.length) {
|
|
308
|
+
case 2:
|
|
309
|
+
generator.addSimpleMapping(line, column);
|
|
310
|
+
return;
|
|
311
|
+
case 4:
|
|
312
|
+
generator.addSourceMapping(line, column, mapping[2], mapping[3]);
|
|
313
|
+
return;
|
|
314
|
+
case 5:
|
|
315
|
+
generator.addNamedSourceMapping(
|
|
316
|
+
line,
|
|
317
|
+
column,
|
|
318
|
+
mapping[2],
|
|
319
|
+
mapping[3],
|
|
320
|
+
mapping[4],
|
|
321
|
+
);
|
|
322
|
+
return;
|
|
328
323
|
}
|
|
324
|
+
throw new Error(`Invalid mapping: [${mapping.join(', ')}]`);
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
const newline = /\r\n?|\n|\u2028|\u2029/g;
|
package/rn-babelrc.json
DELETED