/*!
 * normalize-path <https://github.com/jonschlinkert/normalize-path>
 *
 * Copyright (c) 2014 Jon Schlinkert, contributors.
 * Licensed under the MIT License
 */

'use strict';

module.exports = function(filepath, strip) {
  filepath = filepath
    .replace(/[\\\/]+/g, '/')
    .replace(/^\.[\\\/]/g, '')
    .toLowerCase();

  if (strip !== false) {
    return filepath.replace(/\/$/g, '')
  }
  return filepath;
};
