normalizeFilePaths.js 283 B

123456789101112
  1. const slash = require('slash')
  2. module.exports = function normalizeFilePaths (files) {
  3. Object.keys(files).forEach(file => {
  4. const normalized = slash(file)
  5. if (file !== normalized) {
  6. files[normalized] = files[file]
  7. delete files[file]
  8. }
  9. })
  10. return files
  11. }