smipper 29.0.0 → 30.0.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/dist/loadUri.js +7 -25
- package/package.json +1 -1
package/dist/loadUri.js
CHANGED
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.loadUri = void 0;
|
|
27
|
-
const sourceMap = __importStar(require("source-map"));
|
|
28
7
|
const load_1 = require("./load");
|
|
29
|
-
|
|
8
|
+
const assert_1 = __importDefault(require("assert"));
|
|
9
|
+
const source_map_1 = __importDefault(require("source-map"));
|
|
10
|
+
function loadUri(smipper, path) {
|
|
30
11
|
if (path[0] === "/") {
|
|
31
12
|
path = "file://" + path;
|
|
32
13
|
}
|
|
@@ -47,6 +28,7 @@ async function loadUri(smipper, path) {
|
|
|
47
28
|
const mapUrl = jsData.substring(idx + 21);
|
|
48
29
|
const match = /^(data:.+\/.+;)base64,/.exec(mapUrl);
|
|
49
30
|
if (match) {
|
|
31
|
+
(0, assert_1.default)(match[1] !== undefined);
|
|
50
32
|
return mapUrl.substring(match[1].length);
|
|
51
33
|
}
|
|
52
34
|
if (mapUrl.indexOf("://") != -1) {
|
|
@@ -64,7 +46,7 @@ async function loadUri(smipper, path) {
|
|
|
64
46
|
})
|
|
65
47
|
.then(async (sourceMapData) => {
|
|
66
48
|
const parsed = JSON.parse(sourceMapData);
|
|
67
|
-
const smap = await new
|
|
49
|
+
const smap = await new source_map_1.default.SourceMapConsumer(parsed);
|
|
68
50
|
const pending = smipper.sourceMaps[path];
|
|
69
51
|
// sourceMaps.delete(path);
|
|
70
52
|
if (pending) {
|