-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypescript-4.5.5.patch
More file actions
54 lines (54 loc) · 1.63 KB
/
typescript-4.5.5.patch
File metadata and controls
54 lines (54 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/lib/typescript.js b/lib/typescript.js
index c8ac2bc818421de029c03e2e866150cc924c07e0..060c7ee72d069d66bd4515eea719dfb5b836971d 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -43315,11 +43315,19 @@ var ts;
* @internal
*/
function getPnpApi(path) {
- var findPnpApi = require("module").findPnpApi;
- if (findPnpApi === undefined) {
- return undefined;
- }
- return findPnpApi("".concat(path, "/"));
+ var m;
+ try {
+ m = require("module");
+ } catch (error) {
+ }
+ if (!m) {
+ return undefined;
+ }
+ var findPnpApi = m.findPnpApi;
+ if (findPnpApi === undefined) {
+ return undefined;
+ }
+ return findPnpApi("".concat(path, "/"));
}
function loadPnpPackageResolution(packageName, containingDirectory) {
try {
@@ -126809,11 +126817,19 @@ var ts;
|| (!!globalCachePath && ts.startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent));
}
function getPnpApi(path) {
- var findPnpApi = require("module").findPnpApi;
- if (findPnpApi === undefined) {
- return undefined;
- }
- return findPnpApi("".concat(path, "/"));
+ var m;
+ try {
+ m = require("module");
+ } catch (error) {
+ }
+ if (!m) {
+ return undefined;
+ }
+ var findPnpApi = m.findPnpApi;
+ if (findPnpApi === undefined) {
+ return undefined;
+ }
+ return findPnpApi("".concat(path, "/"));
}
function isImportablePathPnp(fromPath, toPath) {
var pnpApi = getPnpApi(fromPath);