mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
use native path
This commit is contained in:
@@ -14,21 +14,7 @@ function statFileAsync(path) {
|
||||
});
|
||||
};
|
||||
|
||||
function pathResolve(root, path) {
|
||||
if (path[0] == '/') return path;
|
||||
|
||||
var arr = root.split('/').concat(path.split('/'));
|
||||
var result = [];
|
||||
arr.forEach(function(slug) {
|
||||
if (slug == '..') result.pop();
|
||||
else if (!slug || slug == '.');
|
||||
else result.push(slug);
|
||||
});
|
||||
return '/' + result.join('/');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
readFileAsync,
|
||||
pathResolve,
|
||||
statFileAsync
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user