modularize util.isAbsolute

by using a polyfill of the Node 0.12 `path.isAbsolute()` method

https://github.com/sindresorhus/path-is-absolute
This commit is contained in:
Sindre Sorhus
2015-02-17 10:16:53 +07:00
parent 5f2865883b
commit bbf5a8f4aa
4 changed files with 11 additions and 26 deletions

View File

@@ -69,13 +69,6 @@ exports.arrayify = function (val) {
throw new TypeError("illegal type for arrayify");
};
exports.isAbsolute = function (loc) {
if (!loc) return false;
if (loc[0] === "/") return true; // unix
if (loc[1] === ":" && loc[2] === "\\") return true; // windows
return false;
};
var templateVisitor = {
enter: function (node, parent, scope, nodes) {
if (t.isExpressionStatement(node)) {