index.js 259 B

12345678910
  1. 'use strict';
  2. var path = require('path');
  3. var isglob = require('is-glob');
  4. module.exports = function globParent(str) {
  5. str += 'a'; // preserves full path in case of trailing path separator
  6. do {str = path.dirname(str)} while (isglob(str));
  7. return str;
  8. };