simplify resolve

master
jonschlinkert 8 years ago
parent b70089f1eb
commit cd92674d95

@ -92,22 +92,12 @@ parse.sync = function parseSync(options) {
*/ */
parse.resolve = function resolve(options) { parse.resolve = function resolve(options) {
var isGlobal = false;
if (options === 'global') {
isGlobal = true;
options = {};
}
if (typeof options === 'string') { if (typeof options === 'string') {
options = { path: options }; options = { type: options };
} }
var opts = extend({cwd: process.cwd()}, options);
// if "global" isn't explicitly defined, let var fp = opts.path || configPath(opts.type);
// `git-config-path` determine the path return path.resolve(opts.cwd, fp);
var type = isGlobal ? 'global' : null;
var opts = extend({path: configPath(type)}, options);
var cwd = opts.cwd || process.cwd();
return path.resolve(cwd, opts.path);
}; };
/** /**

Loading…
Cancel
Save