Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: use external pathIsAbsolute #2620

Closed
wants to merge 1 commit into from
Closed

Conversation

Fishrock123
Copy link
Contributor

@dougwilson thoughts? I removed the tests since it does per-platform checking.

@Fishrock123
Copy link
Contributor Author

@dougwilson dougwilson self-assigned this Apr 17, 2015
if (':' == path[1] && '\\' == path[2]) return true;
if ('\\\\' == path.substring(0, 2)) return true; // Microsoft Azure absolute path
};
exports.isAbsolute = pathIsAbsolute;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into this, it's unfortunate that since path-is-absolute is actually exporting a platform-specific absolute function, this check is not actually backwards-compatible. Yes, path-is-absolute is doing the "better thing", but I fear what this could break. The problem really comes down to Windows: if people are giving the path '/some/layout/index.hbs', our views currently thinks it's absolute and we do not prepend the root, and so on Windows, it'll map to 'C:\\some\\layout\\index.hbs', where the drive is dependent on process.cwd().

Thoughts?

We should definately move exclusively to this module in 5.x, but in 4.x, we can probably just do return pathIsAbsolute.posix(path) || pathIsAbsolute.win32(path).

@dougwilson dougwilson added the 5.x label Jun 20, 2015
@dougwilson dougwilson added this to the 5.0 milestone Jun 20, 2015
@dougwilson dougwilson mentioned this pull request Jul 7, 2015
39 tasks
Fishrock123 added a commit that referenced this pull request Jul 7, 2015
@dougwilson
Copy link
Contributor

Ok, this has been integrated into the 5.x branch and published as part of the 5.0.0-alpha.2 release!

@dougwilson dougwilson closed this Jul 7, 2015
@dougwilson dougwilson deleted the external-isAbsolute branch June 1, 2016 05:16
@romellem
Copy link

romellem commented Aug 19, 2019

Just curious, is there a reason why this lib doesn't use the native path.isAbsolute? Looking at path-is-absolute, it isn't clear if it is doing anything different.

@LinusU
Copy link
Member

LinusU commented Aug 19, 2019

This package is no longer relevant as Node.js 0.12 is unmaintained.

Seems like it was only intended to bring path.isAbsolute to older versions of node...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants