feature(bower) philip v1.3.0

This commit is contained in:
coderaiser 2015-07-20 04:09:32 -04:00
parent ae62423fe0
commit 1d8998a133
7 changed files with 45 additions and 24 deletions

View file

@ -30,6 +30,6 @@
"vk-openapi": "~0.0.1",
"domtokenlist-shim": "~1.1.0",
"promise-polyfill": "~2.1.0",
"philip": "~1.2.1"
"philip": "~1.3.0"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "philip",
"version": "1.2.1",
"version": "1.3.0",
"homepage": "https://github.com/coderaiser/domfs-philip",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
@ -26,14 +26,14 @@
"findit": "~1.1.0",
"execon": "~1.2.2"
},
"_release": "1.2.1",
"_release": "1.3.0",
"_resolution": {
"type": "version",
"tag": "v1.2.1",
"commit": "21c81406c74cfe0bba678c2a5b91bbf628756e5b"
"tag": "v1.3.0",
"commit": "103d5c3cc2fdd8d2857b003e52bc3c4cead207d7"
},
"_source": "git://github.com/coderaiser/domfs-philip.git",
"_target": "~1.2.1",
"_target": "~1.3.0",
"_originalSource": "philip",
"_direct": true
}

View file

@ -1,3 +1,9 @@
2015.07.20, v1.3.0
feature:
- (philip) add optional parameters to processingFn: i, n
2015.07.19, v1.2.1
fix:

View file

@ -36,7 +36,7 @@ Or any other node-compitable [EventEmitter](https://iojs.org/api/events.html "Ev
entry = item.webkitGetAsEntry();
upload = philip(entry, function(type, name, data, callback) {
upload = philip(entry, function(type, name, data/*, i, n,*/, callback) {
var error = null;
switch(type) {

View file

@ -1,6 +1,6 @@
{
"name": "philip",
"version": "1.2.1",
"version": "1.3.0",
"homepage": "https://github.com/coderaiser/domfs-philip",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"

View file

@ -50,11 +50,24 @@
}
Philip.prototype._process = function() {
var el,
var args,
argsLength = this._processingFn.length,
el,
data,
self = this,
name = self._dirs.shift(),
type = 'directory';
self = this,
name = self._dirs.shift(),
type = 'directory',
fn = function(error) {
++self._i;
if (error) {
self.emit('error', error);
self.pause();
}
self._process();
self._progress();
};
if (!name) {
type = 'file';
@ -69,17 +82,19 @@
if (!name) {
self.emit('end');
} else if (!this._pause) {
self._processingFn(type, name, data, function(error) {
++self._i;
if (error) {
self.emit('error', error);
self.pause();
}
self._process();
self._progress();
});
switch(argsLength) {
default:
args = [type, name, data];
break;
case 6:
args = [type, name, data, this._i, this._n];
break;
}
args.push(fn);
self._processingFn.apply(null, args);
}
};

View file

@ -1,7 +1,7 @@
{
"name": "philip",
"private": true,
"version": "1.2.1",
"version": "1.3.0",
"description": "Process files and directories in DOM File System",
"main": "lib/philip.js",
"dependencies": {},