1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-09 06:10:54 +00:00
notes/node_modules/is-dotfile/index.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

16 lines
391 B
JavaScript

/*!
* is-dotfile <https://github.com/regexps/is-dotfile>
*
* Copyright (c) 2015 Jon Schlinkert, contributors.
* Licensed under the MIT license.
*/
module.exports = function(str) {
if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) {
return true;
}
var last = str.lastIndexOf('/');
return last !== -1 ? str.charCodeAt(last + 1) === 46 /* . */ : false;
};