react-native-in-app-debugger 1.0.82 → 1.0.83
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/package.json +1 -1
- package/postinstall.js +14 -1
- package/useApiInterceptor.js +1 -1
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -8,4 +8,17 @@ for (const d in read('../../package.json').dependencies) {
|
|
|
8
8
|
} catch (e) {}
|
|
9
9
|
}
|
|
10
10
|
fs.writeSync(parentDependencies, '}');
|
|
11
|
-
fs.closeSync(parentDependencies);
|
|
11
|
+
fs.closeSync(parentDependencies);
|
|
12
|
+
|
|
13
|
+
const isRNVersionGTE0780 = (v) => v.split('.').map(Number)[1] < 78;
|
|
14
|
+
|
|
15
|
+
if (isRNVersionGTE0780(read('../react-native/package.json').version)) {
|
|
16
|
+
try {
|
|
17
|
+
const filePath = './useApiInterceptor.js';
|
|
18
|
+
const regex = new RegExp('react-native/src/private/inspector/XHRInterceptor.js', 'g');
|
|
19
|
+
const fileContent = fs.readFileSync(filePath, 'utf8').replace(regex, 'react-native/Libraries/Network/XHRInterceptor.js');
|
|
20
|
+
fs.writeFileSync(filePath, fileContent, 'utf8');
|
|
21
|
+
} catch (err) {
|
|
22
|
+
console.error('Error while replacing strings in file:', err);
|
|
23
|
+
}
|
|
24
|
+
}
|
package/useApiInterceptor.js
CHANGED