smipper 36.0.0 → 37.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/Rewrite.js +2 -0
- package/dist/processFrame.js +2 -0
- package/dist/rewriteOCA.js +46 -0
- package/package.json +1 -1
package/dist/Rewrite.js
ADDED
package/dist/processFrame.js
CHANGED
|
@@ -7,11 +7,13 @@ exports.processFrame = void 0;
|
|
|
7
7
|
const loadUri_1 = require("./loadUri");
|
|
8
8
|
const buildStackLine_1 = require("./buildStackLine");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const rewriteOCA_1 = require("./rewriteOCA");
|
|
10
11
|
function processFrame(smipper, functionName, url, line, column) {
|
|
11
12
|
smipper.verbose("got frame", functionName, url, line, column);
|
|
12
13
|
if (functionName.endsWith("@")) {
|
|
13
14
|
functionName = functionName.substring(0, functionName.length - 1);
|
|
14
15
|
}
|
|
16
|
+
url = (0, rewriteOCA_1.rewriteOCA)(smipper, url);
|
|
15
17
|
return new Promise((resolve) => {
|
|
16
18
|
let newUrl, newLine, newColumn;
|
|
17
19
|
smipper.verbose("calling loadUri", url);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rewriteOCA = void 0;
|
|
4
|
+
const rewrites = [
|
|
5
|
+
{
|
|
6
|
+
pattern: /https:\/\/[^/]*nflxso.net\/genc\/nrdp\/milo\/1.0.([0-9]+)-[A-Za-z0-9]*\/milo.prod.js/,
|
|
7
|
+
replacement: [
|
|
8
|
+
"https://build.dta.netflix.com/nrdp/milo/(branch=master&repoBuildNumber=",
|
|
9
|
+
1,
|
|
10
|
+
")/dist/milo.prod.js"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
pattern: /https:\/\/[^/]*nflxso.net\/genc\/nrdp\/poby\/1.0.([0-9]+)-[A-Za-z0-9]*\/poby.prod.js/,
|
|
15
|
+
replacement: [
|
|
16
|
+
"https://build.dta.netflix.com/nrdp/poby/(branch=master&repoBuildNumber=",
|
|
17
|
+
1,
|
|
18
|
+
")/dist/poby.prod.js"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
pattern: /https:\/\/[^/]*nflxso.net\/genc\/nrdp\/bogart\/1.0.([0-9]+)-[A-Za-z0-9]*\/index.release.js/,
|
|
23
|
+
replacement: ["https://build.dta.netflix.com/nrdp/bogart/(repoBuildNumber=", 1, ")/dist/index.release.js"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
pattern: /https:\/\/[^/]*nflxso.net\/genc\/nrdp\/bogart\/1.0.([0-9]+)-[A-Za-z0-9]*\/worker.release.js/,
|
|
27
|
+
replacement: ["https://build.dta.netflix.com/nrdp/bogart/(repoBuildNumber=", 1, ")/dist/worker.release.js"]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
pattern: /https:\/\/[^/]*nflxso.net\/genc\/nrdp\/bogart\/1.0.([0-9]+)-[A-Za-z0-9]*\/animation.release.js/,
|
|
31
|
+
replacement: ["https://build.dta.netflix.com/nrdp/bogart/(repoBuildNumber=", 1, ")/dist/animation.release.js"]
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
function rewriteOCA(smipper, url) {
|
|
35
|
+
for (const rewrite of rewrites) {
|
|
36
|
+
const match = rewrite.pattern.exec(url);
|
|
37
|
+
smipper.verbose("Trying to match", url, "against", rewrite, "=>", match);
|
|
38
|
+
if (match) {
|
|
39
|
+
return rewrite.replacement
|
|
40
|
+
.map((x) => (typeof x === "string" ? x : String(match[x])))
|
|
41
|
+
.join("");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return url;
|
|
45
|
+
}
|
|
46
|
+
exports.rewriteOCA = rewriteOCA;
|