Portfolio/node_modules/glob-parent/index.js
oitsjustjose 4e066bffc9 Init
2017-02-25 03:50:31 -05:00

10 lines
259 B
JavaScript

'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
do {str = path.dirname(str)} while (isglob(str));
return str;
};