Skip to content

Commit 45dde7b

Browse files
committed
select funtion for path absolute
1 parent c6c895b commit 45dde7b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Utilities.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ exports.convertPropToJoinKeyProp = function (props, opts) {
271271

272272
exports.getRealPath = function (path_str, stack_index) {
273273
var path = require("path"); // for now, load here (only when needed)
274-
var pathIsAbsolute = require('path-is-absolute');
275274
var cwd = process.cwd();
276275
var err = new Error();
277276
var tmp = err.stack.split(/\r?\n/)[typeof stack_index !== "undefined" ? stack_index : 3], m;
@@ -283,7 +282,7 @@ exports.getRealPath = function (path_str, stack_index) {
283282
} else if ((m = tmp.match(/^\s*at\s+.+\s+\((.+):\d+:\d+\)$/)) !== null) {
284283
cwd = path.dirname(m[1]);
285284
}
286-
285+
var pathIsAbsolute = path.isAbsolute || require('path-is-absolute');
287286
if (!pathIsAbsolute(path_str)) {
288287
path_str = path.join(cwd, path_str);
289288
}

0 commit comments

Comments
 (0)