Repository URL to install this package:
|
Version:
5.0.0-rc.11 ▾
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
require('path');
var index = require('./node_modules/is-glob/index.js');
var index$1 = require('../path-dirname/index.js');
var os = _interopDefault(require('os'));
var isWin32 = os.platform() === 'win32';
var globParent = function globParent(str) {
// flip windows path separators
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
// special case for strings ending in enclosure containing path separator
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
// preserves full path in case of trailing path separator
str += 'a';
// remove path parts that are globby
do {str = index$1.default.posix(str);}
while (index.default(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
// remove escape chars and return result
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
};
exports.__moduleExports = globParent;
exports.default = globParent;
//# sourceMappingURL=index.js.map