Skip to content

Commit

Permalink
Add regex for normalizing path
Browse files Browse the repository at this point in the history
  • Loading branch information
thangngoc89 committed Nov 24, 2015
1 parent cc8b115 commit c9cf34a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var extname = require('path').extname;
var path = require('path');
var extname = path.extname;
var yaml = require('js-yaml');

/**
Expand Down Expand Up @@ -33,7 +33,7 @@ function plugin(opts){
var exts = Object.keys(parsers);

for (var key in opts) {
var file = opts[key];
var file = opts[key].replace(/(\/|\\)/g, path.sep);
var ext = extname(file);
if (!~exts.indexOf(ext)) throw new Error('unsupported metadata type "' + ext + '"');
if (!metadata[key] || files[file]) {
Expand Down

0 comments on commit c9cf34a

Please sign in to comment.