index.js 391 B

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