Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolve (success, fail, path, fsType, sandbox, options, size) {
options = options || { create: false };
size = size || info.MAX_SIZE;
if (size > info.MAX_SIZE) {
// bb10 does not respect quota; fail at unreasonably large size
fail(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
} else if (path.indexOf(':') > -1) {
// files with : character are not valid in Cordova apps
fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
} else {
requestAnimationFrame(function () {
cordova.exec(function () { // eslint-disable-line no-undef
requestAnimationFrame(function () {
resolveNative(success, fail, path, fsType, options, size);
});
}, fail, 'File', 'setSandbox', [sandbox], false);
});
}
}
function resolve (success, fail, path, fsType, sandbox, options, size) {
options = options || { create: false };
size = size || info.MAX_SIZE;
if (size > info.MAX_SIZE) {
// bb10 does not respect quota; fail at unreasonably large size
fail(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
} else if (path.indexOf(':') > -1) {
// files with : character are not valid in Cordova apps
fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
} else {
requestAnimationFrame(function () {
cordova.exec(function () { // eslint-disable-line no-undef
requestAnimationFrame(function () {
resolveNative(success, fail, path, fsType, options, size);
});
}, fail, 'File', 'setSandbox', [sandbox], false);
});
}
}