2 * normalize-path <https://github.com/jonschlinkert/normalize-path>
4 * Copyright (c) 2014-2015, Jon Schlinkert.
5 * Licensed under the MIT License
8 module.exports = function normalizePath(str, stripTrailing) {
9 if (typeof str !== 'string') {
10 throw new TypeError('expected a string');
12 str = str.replace(/[\\\/]+/g, '/');
13 if (stripTrailing !== false) {
14 str = str.replace(/\/$/, '');