Unbreak RN JS server for Android.

This commit is contained in:
Hedger Wang 2015-05-20 18:38:55 -07:00
parent 08844e3ddc
commit b46c94aaf9
1 changed files with 9 additions and 0 deletions

View File

@ -52,6 +52,15 @@ function parseCommandLine(config) {
if (argv[command] === 'false') {
argv[command] = false;
}
if (config[i].type === 'string') {
// According to https://github.com/substack/node-optimist#numbers,
// every argument that looks like a number should be converted to one.
var strValue = argv[command];
var numValue = strValue ? Number(strValue) : undefined;
if (typeof numValue === 'number' && !isNaN(numValue)) {
argv[command] = numValue;
}
}
}
// Show --help