Comparing version 9.2.1 to 10.0.0
@@ -442,8 +442,35 @@ var util = require('util') | ||
exports.open = function (path, flags, mode, callback) { | ||
path = resolve(path) | ||
var isEntry = false | ||
if (!nullCheck(path, callback)) return | ||
if (typeof path === 'object') { | ||
isEntry = true | ||
} else { | ||
path = resolve(path) | ||
} | ||
console.log(path.constructor) | ||
flags = flagToString(flags) | ||
callback = makeCallback(arguments[arguments.length - 1]) | ||
mode = modeNum(mode, 438 /* =0666 */) | ||
if (!nullCheck(path, callback)) return | ||
// Allow for passing of fileentries to support external fs | ||
if (isEntry) { | ||
if (flags.indexOf('w') > -1 || flags.indexOf('a') > -1) { | ||
path.createWriter(function (fileWriter) { | ||
fileWriter.flags = flags | ||
fileWriter.fullPath = path.fullPath | ||
fds[fileWriter.fullPath] = {} | ||
fds[fileWriter.fullPath].status = 'open' | ||
fileWriter.key = fileWriter.fullPath | ||
callback(null, fileWriter) | ||
}, callback) | ||
} else { | ||
path.file(function (file) { | ||
file.fullPath = path.fullPath | ||
fds[file.fullPath] = {} | ||
fds[file.fullPath].status = 'open' | ||
file.key = file.fullPath | ||
callback(null, file) | ||
}) | ||
} | ||
return | ||
} | ||
window.requestFileSystem( | ||
@@ -450,0 +477,0 @@ window.PERSISTENT, FILESYSTEM_DEFAULT_SIZE, |
{ | ||
"name": "chrome-fs", | ||
"version": "9.2.1", | ||
"version": "10.0.0", | ||
"description": "Use the Node `fs` API in Chrome Apps", | ||
@@ -5,0 +5,0 @@ "main": "main.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
43610
1166