.verb.md

May 30, 2017 ยท View on GitHub

Usage

To be considered a dot directory:

  • the path must contain a dot that is at the beginning of the string or following a slash
  • the next character after the dot must not be another dot
  • one or more non-slash characters must follow the dot
  • a slash must follow after at least one non-dot, non-slash character

To check for dot files, use [is-dotfile][] instead.

var isDotdir = require('{%= name %}');

isDotdir('a/b/c/.gitignore');
//=> false

isDotdir('a/.git/a/b/');
//=> true