Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-promise-fs

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-promise-fs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

LICENSE.md

27

dist/CordovaPromiseFS.js

@@ -172,17 +172,20 @@ var CordovaPromiseFS =

var type = options.persistent? 1: 0;
if(options.fileSystem){
if(options.fileSystem && isCordova){
type = options.fileSystem;
}
// Chrome only supports persistent and temp storage, not the exotic onces from Cordova
if(!isCordova && type > 1) {
console.warn('Chrome does not support fileSystem "'+type+'". Falling back on "0" (temporary).');
type = 0;
// On chrome, request quota to store persistent files
if (!isCordova && type === 1 && navigator.webkitPersistentStorage) {
navigator.webkitPersistentStorage.requestQuota(options.storageSize, function(grantedBytes) {
window.requestFileSystem(type, grantedBytes, resolve, reject);
});
}
if(isNaN(type)) {
window.resolveLocalFileSystemURL(type,function(directory){
resolve(directory.filesystem);
},reject);
}else{
window.requestFileSystem(type, options.storageSize, resolve, reject);
}
// Exotic Cordova Directories (options.fileSystem = string)
if(isNaN(type)) {
window.resolveLocalFileSystemURL(type,function(directory){
resolve(directory.filesystem);
},reject);
// Normal browser usage
} else {
window.requestFileSystem(type, options.storageSize, resolve, reject);
}

@@ -189,0 +192,0 @@ setTimeout(function(){ reject(new Error('Could not retrieve FileSystem after 5 seconds.')); },5100);

@@ -125,17 +125,20 @@ /**

var type = options.persistent? 1: 0;
if(options.fileSystem){
if(options.fileSystem && isCordova){
type = options.fileSystem;
}
// Chrome only supports persistent and temp storage, not the exotic onces from Cordova
if(!isCordova && type > 1) {
console.warn('Chrome does not support fileSystem "'+type+'". Falling back on "0" (temporary).');
type = 0;
// On chrome, request quota to store persistent files
if (!isCordova && type === 1 && navigator.webkitPersistentStorage) {
navigator.webkitPersistentStorage.requestQuota(options.storageSize, function(grantedBytes) {
window.requestFileSystem(type, grantedBytes, resolve, reject);
});
}
if(isNaN(type)) {
window.resolveLocalFileSystemURL(type,function(directory){
resolve(directory.filesystem);
},reject);
}else{
window.requestFileSystem(type, options.storageSize, resolve, reject);
}
// Exotic Cordova Directories (options.fileSystem = string)
if(isNaN(type)) {
window.resolveLocalFileSystemURL(type,function(directory){
resolve(directory.filesystem);
},reject);
// Normal browser usage
} else {
window.requestFileSystem(type, options.storageSize, resolve, reject);
}

@@ -142,0 +145,0 @@ setTimeout(function(){ reject(new Error('Could not retrieve FileSystem after 5 seconds.')); },5100);

{
"name": "cordova-promise-fs",
"version": "1.0.0",
"version": "1.0.1",
"description": "Cordova FileSystem convienence functions that return promises.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc