gulpjs/vinyl

Behavior of `file.base` when set to `file.cwd`?

phated opened this issue · 2 comments

I just ran into this while working on vinyl-sourcemap: if someone does file.base = file.cwd, what should the resulting behavior be? Currently we don't do anything due to the check at https://github.com/gulpjs/vinyl/blob/master/index.js#L215

cc @darsain

If base after normalization equals cwd, it should result in delete this._base; so the getter can default to this._cwd. Not doing anything there is definitely a bug.

@darsain cool, thanks for looking at that. It felt like a bug but I wasn't sure.