aboutsummaryrefslogtreecommitdiff
path: root/node_modules/glob-parent/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/glob-parent/index.js')
-rw-r--r--node_modules/glob-parent/index.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js
new file mode 100644
index 000000000..9a7e59375
--- /dev/null
+++ b/node_modules/glob-parent/index.js
@@ -0,0 +1,11 @@
+'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');
+};