0.1.1 • Published 6 years ago
@regexp-extra/dot-dir v0.1.1
RegExp for matching dot directories, like .git/
.
const DOT_DIR = require('@regexp-extra/dot-dir');
// -> regular expression
DOT_DIR.test('.git');
// false
DOT_DIR.test('.git/a/b/c');
// true
DOT_DIR.test('a/.git/b/c');
// true
'a/.git/b/c'.match(DOT_DIR);
// [ '/.git/',
// '.git',
// index: 1,
// input: 'a/.git/b/c',
// groups: undefined ]
credits: taken directly from regexhq/dotdir-regex.