mem-fs-editor
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -18,11 +18,11 @@ 'use strict'; | ||
exports.copy = function (from, to, options) { | ||
from = util.globify(from); | ||
to = path.resolve(to); | ||
options = options || {}; | ||
var fromGlob = util.globify(from); | ||
var globOptions = extend(options.globOptions || {}, {nodir: true}); | ||
var diskFiles = globby.sync(from, globOptions); | ||
var diskFiles = globby.sync(fromGlob, globOptions); | ||
var storeFiles = []; | ||
this.store.each(file => { | ||
if (multimatch([file.path], from).length !== 0) { | ||
if (multimatch([file.path], fromGlob).length !== 0) { | ||
storeFiles.push(file.path); | ||
@@ -34,3 +34,3 @@ } | ||
var generateDestination = () => to; | ||
if (Array.isArray(from) || glob.hasMagic(from)) { | ||
if (Array.isArray(from) || !this.exists(from) || glob.hasMagic(from)) { | ||
assert( | ||
@@ -37,0 +37,0 @@ !this.exists(to) || fs.statSync(to).isDirectory(), |
'use strict'; | ||
module.exports = function (filepath) { | ||
var file = this.store.get(filepath); | ||
var file = this.store.get(filepath); | ||
return file.contents !== null && file.state !== 'deleted'; | ||
return file.contents !== null && file.state !== 'deleted'; | ||
}; |
{ | ||
"name": "mem-fs-editor", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "File edition helpers working on top of mem-fs", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
16526