cordova-promise-fs
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "cordova-promise-fs", | ||
"main": "CordovaPromiseFS.js", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/markmarijnissen/cordova-promise-fs", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -127,5 +127,5 @@ (function(){ | ||
/* synchronous helper to get internal URL. */ | ||
function toInternlURLSync(path){ | ||
function toInternalURLSync(path){ | ||
if(path[0] !== '/') path = '/' + path; | ||
return 'cdvfile://localhost/'+(this.options.persistent? 'persistent':'temporary') + path; | ||
return 'cdvfile://localhost/'+(options.persistent? 'persistent':'temporary') + path; | ||
} | ||
@@ -229,6 +229,10 @@ | ||
var method = mustExist? file:exists; | ||
return method(path).then(function(fileEntry){ | ||
return new Promise(function(resolve,reject){ | ||
fileEntry.remove(resolve,reject); | ||
}); | ||
return new Promise(function(resolve,reject){ | ||
method(path).then(function(fileEntry){ | ||
if(fileEntry !== false) { | ||
fileEntry.remove(resolve,reject); | ||
} else { | ||
resolve(); | ||
} | ||
},reject); | ||
}); | ||
@@ -325,3 +329,3 @@ } | ||
serverUrl = encodeURI(serverUrl); | ||
localPath = toInternlURLSync(localPath); | ||
localPath = toInternalURLSync(localPath); | ||
transferQueue.push([ft,isDownload,serverUrl,localPath,resolve,reject,options.trustAllHosts || false,options]); | ||
@@ -373,2 +377,3 @@ popTransferQueue(); | ||
toDataURL:toDataURL, | ||
options: options, | ||
Promise: Promise | ||
@@ -375,0 +380,0 @@ }; |
19
index.js
@@ -123,5 +123,5 @@ /** | ||
/* synchronous helper to get internal URL. */ | ||
function toInternlURLSync(path){ | ||
function toInternalURLSync(path){ | ||
if(path[0] !== '/') path = '/' + path; | ||
return 'cdvfile://localhost/'+(this.options.persistent? 'persistent':'temporary') + path; | ||
return 'cdvfile://localhost/'+(options.persistent? 'persistent':'temporary') + path; | ||
} | ||
@@ -225,6 +225,10 @@ | ||
var method = mustExist? file:exists; | ||
return method(path).then(function(fileEntry){ | ||
return new Promise(function(resolve,reject){ | ||
fileEntry.remove(resolve,reject); | ||
}); | ||
return new Promise(function(resolve,reject){ | ||
method(path).then(function(fileEntry){ | ||
if(fileEntry !== false) { | ||
fileEntry.remove(resolve,reject); | ||
} else { | ||
resolve(); | ||
} | ||
},reject); | ||
}); | ||
@@ -321,3 +325,3 @@ } | ||
serverUrl = encodeURI(serverUrl); | ||
localPath = toInternlURLSync(localPath); | ||
localPath = toInternalURLSync(localPath); | ||
transferQueue.push([ft,isDownload,serverUrl,localPath,resolve,reject,options.trustAllHosts || false,options]); | ||
@@ -369,4 +373,5 @@ popTransferQueue(); | ||
toDataURL:toDataURL, | ||
options: options, | ||
Promise: Promise | ||
}; | ||
}; |
{ | ||
"name": "cordova-promise-fs", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Cordova FileSystem convienence functions that return promises.", | ||
@@ -5,0 +5,0 @@ "main": "index.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
28289
705