Comparing version 0.1.6 to 0.1.7
25
ftp.js
@@ -169,3 +169,4 @@ var util = require('util'), | ||
+ parsed[4]; | ||
self._pasvPort = (parseInt(parsed[5]) * 256) + parseInt(parsed[6]); | ||
self._pasvPort = (parseInt(parsed[5], 10) * 256) | ||
+ parseInt(parsed[6], 10); | ||
self._pasvConnect(); | ||
@@ -444,3 +445,3 @@ return; | ||
FTP.prototype.size = function(path, cb) { | ||
if (this._state !== 'authorized' || !this._feat['SIZE']) | ||
if (this._state !== 'authorized' || !this._feat.SIZE) | ||
return false; | ||
@@ -451,3 +452,3 @@ return this.send('SIZE', path, cb); | ||
FTP.prototype.lastMod = function(path, cb) { | ||
if (this._state !== 'authorized' || !this._feat['MDTM']) | ||
if (this._state !== 'authorized' || !this._feat.MDTM) | ||
return false; | ||
@@ -471,4 +472,4 @@ return this.send('MDTM', path, function(e, text) { | ||
FTP.prototype.restart = function(offset, cb) { | ||
if (this._state !== 'authorized' || !this._feat['REST'] | ||
|| !(/STREAM/i.test(this._feat['REST']))) | ||
if (this._state !== 'authorized' || !this._feat.REST | ||
|| !(/STREAM/i.test(this._feat.REST))) | ||
return false; | ||
@@ -608,3 +609,3 @@ return this.send('REST', offset, cb); | ||
else if (type === 'MLSD') | ||
result = parseMList(lines[i], numFields); | ||
result = parseMList(lines[i]); | ||
emitter.emit((typeof result === 'string' ? 'raw' : 'entry'), result); | ||
@@ -619,3 +620,3 @@ } | ||
for (var i=0,match,len=lines.length; i<len; ++i) { | ||
if (match = lines[i].match(/^(\d{3})(?:$|(\s|\-)(.+))/)) { | ||
if (match = lines[i].match(/^(\d{3})(?:$|(\s|\-)(.*))/)) { | ||
if (match[2] === '-') { | ||
@@ -628,5 +629,5 @@ if (match[3]) | ||
if (match[3].length) | ||
resps.push([parseInt(match[1]), match[3]]); | ||
resps.push([parseInt(match[1], 10), match[3]]); | ||
else | ||
resps.push([parseInt(match[1])]); | ||
resps.push([parseInt(match[1], 10)]); | ||
multiline = ''; | ||
@@ -758,3 +759,3 @@ } else | ||
function getGroup(code) { | ||
return parseInt(code / 10) % 10; | ||
return parseInt(code / 10, 10) % 10; | ||
} | ||
@@ -780,3 +781,3 @@ | ||
// Handle case when target is a string or something (possible in deep copy) | ||
if (typeof target !== "object" && !typeof target === 'function') | ||
if (typeof target !== "object" && typeof target !== 'function') | ||
target = {}; | ||
@@ -796,3 +797,3 @@ var isPlainObject = function(obj) { | ||
// if last one is own, then all properties are own. | ||
var last_key; | ||
var last_key, key; | ||
for (key in obj) | ||
@@ -799,0 +800,0 @@ last_key = key; |
{ "name": "ftp", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "An FTP client module for node.js", |
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
42829
773