Skip to content

Commit

Permalink
use dotfile-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed May 30, 2017
1 parent 65e7b04 commit 9dc2ebd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
* Released under the MIT License.
*/

var dotfileRegex = require('dotfile-regex');

module.exports = function(str) {
if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) {
return true;
}
var slash = str.lastIndexOf('/');
return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false;
return dotfileRegex().test(str);
};

0 comments on commit 9dc2ebd

Please sign in to comment.