gulpjs / vinyl

Virtual file format.
MIT License
1.28k stars 107 forks source link

0.4.6 clone() docs don't match the implementation #125

Closed strugee closed 7 years ago

strugee commented 7 years ago

https://github.com/gulpjs/vinyl/tree/v0.4.6#clone says that custom attributes are deep-cloned, but this isn't the case - they're only deep-cloned if true is passed to clone().

Probably the docs should read something like:

Returns a new File object with all attributes cloned. Custom attributes are shallow-cloned unless you pass true, in which case they're deep-cloned.

I'm happy to provide a PR for this, but I'd need a branch created as you can't send PRs against tags (obviously).

phated commented 7 years ago

It looks so. Not sure I really want to muck with the history again to fix this when we are very past that version.

strugee commented 7 years ago

Yeah, normally I'd agree with you but I think it makes sense in this case since Gulp 3 has such a wide user base.

To be clear I'm not advocating for rewriting history, just branching from the relevant commit

phated commented 7 years ago

And re-tagging or bumping which I'm not going to do. If this issue is present in gulp docs, I'll take a change there but not on this library.

sojuker commented 7 years ago

gulp 3.9.1 use vinyl 0.4.6 (through vinyl-fs) gulp-util 3.0.8 use vinyl 0.5.3 and vinyl's lastest version is 2.0.1

the API and the vinyl object diff from different versions, very easy to get confused.