aboutsummaryrefslogtreecommitdiff
path: root/node_modules/normalize-path/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/normalize-path/index.js')
-rw-r--r--node_modules/normalize-path/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js
new file mode 100644
index 000000000..137f6015b
--- /dev/null
+++ b/node_modules/normalize-path/index.js
@@ -0,0 +1,17 @@
+/*!
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License
+ */
+
+module.exports = function normalizePath(str, stripTrailing) {
+ if (typeof str !== 'string') {
+ throw new TypeError('expected a string');
+ }
+ str = str.replace(/[\\\/]+/g, '/');
+ if (stripTrailing !== false) {
+ str = str.replace(/\/$/, '');
+ }
+ return str;
+};