smipper 9.0.0 → 12.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/index.js +17 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -73,6 +73,14 @@ function load(path)
|
|
|
73
73
|
}
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
+
if (!path.startsWith("http://") && !path.startsWith("https://")) {
|
|
77
|
+
reject(new Error("Not a url"));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (path.startsWith("http://localcontrol.netflix.com/")) {
|
|
81
|
+
reject(new Error("No need to resolve this one"));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
76
84
|
let retryIndex = 0;
|
|
77
85
|
async function get()
|
|
78
86
|
{
|
|
@@ -109,11 +117,20 @@ function loadUri(path) {
|
|
|
109
117
|
return path + ".map";
|
|
110
118
|
|
|
111
119
|
const mapUrl = jsData.substr(idx + 21);
|
|
120
|
+
const match = /^(data:.+\/.+;)base64,/.exec(mapUrl);
|
|
121
|
+
if (match) {
|
|
122
|
+
return mapUrl.substr(match[1].length);
|
|
123
|
+
}
|
|
112
124
|
if (mapUrl.indexOf("://") != -1) {
|
|
113
125
|
return mapUrl;
|
|
114
126
|
}
|
|
127
|
+
// console.log(mapUrl);
|
|
115
128
|
return (new url.URL(mapUrl, path)).href;
|
|
116
129
|
}).then(mapUrl => {
|
|
130
|
+
console.log(mapUrl.substr(0, 20));
|
|
131
|
+
if (mapUrl.startsWith("base64,")) {
|
|
132
|
+
return Buffer.from(mapUrl.substr(7), "base64").toString();
|
|
133
|
+
}
|
|
117
134
|
return load(mapUrl);
|
|
118
135
|
}).then(sourceMapData => {
|
|
119
136
|
const parsed = JSON.parse(sourceMapData);
|