wallet-core/node_modules/glob-parent/index.js
2016-11-03 01:33:53 +01:00

12 lines
350 B
JavaScript

'use strict';
var path = require('path');
var isglob = require('is-glob');
var pathDirname = require('path-dirname');
module.exports = function globParent(str) {
str += 'a'; // preserves full path in case of trailing path separator
do {str = pathDirname.posix(str)} while (isglob(str));
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
};