react-native-networking-patch
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "react-native-networking-patch", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Improves the performance of the React Native network module and adds a timeout feature.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
48
patch.js
@@ -19,6 +19,6 @@ #!/usr/bin/env node | ||
const packageFile = fs.readFileSync(RNPackageFile); | ||
let package = null; | ||
let packageJSON = null; | ||
try { | ||
package = JSON.parse(packageFile); | ||
packageJSON = JSON.parse(packageFile); | ||
} catch (e) { | ||
@@ -28,3 +28,3 @@ console.error(e); | ||
if (!package) { | ||
if (!packageJSON) { | ||
console.log('[!] Failed to get version of react-native'); | ||
@@ -34,20 +34,18 @@ process.exit(1); | ||
const version = package.version.split('.'); | ||
const majorVersion = parseInt(version[0], 10); | ||
const version = packageJSON.version.split('.'); | ||
const minorVersion = parseInt(version[1], 10); | ||
const patchVersion = parseInt(version[2], 10); | ||
let patchDir = ''; | ||
switch (minorVersion) { | ||
case 62: | ||
patchDir = '0.62.2'; | ||
break; | ||
case 61: | ||
patchDir = '0.61.5'; | ||
break; | ||
case 60: | ||
patchDir = '0.60.6'; | ||
break; | ||
default: | ||
break; | ||
case 62: | ||
patchDir = '0.62.2'; | ||
break; | ||
case 61: | ||
patchDir = '0.61.5'; | ||
break; | ||
case 60: | ||
patchDir = '0.60.6'; | ||
break; | ||
default: | ||
break; | ||
} | ||
@@ -61,6 +59,6 @@ | ||
function getAllFiles(dirPath, arrayOfFiles) { | ||
files = fs.readdirSync(dirPath) | ||
arrayOfFiles = arrayOfFiles || [] | ||
const files = fs.readdirSync(dirPath); | ||
arrayOfFiles = arrayOfFiles || []; | ||
files.forEach(function(file) { | ||
@@ -73,9 +71,9 @@ if (file === '.DS_Store') { | ||
if (fs.statSync(filePath).isDirectory()) { | ||
arrayOfFiles = getAllFiles(filePath, arrayOfFiles) | ||
arrayOfFiles = getAllFiles(filePath, arrayOfFiles); | ||
} else { | ||
arrayOfFiles.push(filePath); | ||
} | ||
}) | ||
return arrayOfFiles | ||
}); | ||
return arrayOfFiles; | ||
} | ||
@@ -82,0 +80,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37701094
2185