2016-10-10 03:43:44 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var path = require('path');
|
|
|
|
var isglob = require('is-glob');
|
|
|
|
|
|
|
|
module.exports = function globParent(str) {
|
|
|
|
str += 'a'; // preserves full path in case of trailing path separator
|
2017-04-20 03:09:25 +02:00
|
|
|
do {str = path.dirname(str)} while (isglob(str));
|
|
|
|
return str;
|
2016-10-10 03:43:44 +02:00
|
|
|
};
|