MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / resolve

Function resolve

packages/webpack5/scripts/jest.setup.ts:58–86  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

56 return {
57 ...path,
58 resolve(...args) {
59 if (args[0] === '__jest__') {
60 return path.join(...args.filter(Boolean));
61 }
62
63 const resolved = path.resolve(...args);
64 if (resolved.includes('__jest__')) {
65 const li = resolved.lastIndexOf('__jest__');
66 return resolved.substr(li);
67 }
68
69 // handle resolutions with __dirname
70 // used in base config's resolveLoader
71 const root = path.resolve(__dirname, '..');
72 if (resolved.startsWith(root)) {
73 const newPath = resolved.replace(root, '__jest__');
74
75 if (newPath.startsWith('__jest__/src')) {
76 return newPath.replace(
77 '__jest__/src',
78 '__jest__/node_modules/@nativescript/webpack/dist'
79 );
80 }
81
82 return newPath;
83 }
84
85 return resolved;
86 },
87 };
88});
89

Callers 15

fileReaderReadyFunction · 0.50
fetchFunction · 0.50
openUrlAsyncFunction · 0.50
openUrlAsyncFunction · 0.50
digestMethod · 0.50
encryptMethod · 0.50
decryptMethod · 0.50
signMethod · 0.50
verifyMethod · 0.50
generateKeyMethod · 0.50
fromAssetMethod · 0.50
fromResourceMethod · 0.50

Calls 6

joinMethod · 0.80
resolveMethod · 0.80
includesMethod · 0.80
lastIndexOfMethod · 0.80
replaceMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected