Cloning the stats object would remove its prototype, meaning it would lose methods normally available on fs.Stats
instances, such as Stats.isDirectory() or Stats.isFile()
This was giving me errors when cloning vinyl instances and then piping them to gulp.dest() streams, which do a directory check if the stats property is present:
/Users/hughsk/Desktop/repos/gulp/lib/createOutputStream/index.js:19
if (file.stat && file.stat.isDirectory()) {
^
TypeError: Object #<Object> has no method 'isDirectory'
at /Users/hughsk/Desktop/repos/gulp/lib/createOutputStream/index.js:19:34
at /Users/hughsk/Desktop/repos/gulp/node_modules/mkdirp/index.js:38:26
at Object.oncomplete (fs.js:107:15)
Cloning the stats object would remove its prototype, meaning it would lose methods normally available on
fs.Stats
instances, such asStats.isDirectory()
orStats.isFile()
This was giving me errors when cloning vinyl instances and then piping them to
gulp.dest()
streams, which do a directory check if thestats
property is present:This should fix the problem :)