pax_global_header00006660000000000000000000000064126113447440014520gustar00rootroot0000000000000052 comment=509fbfd3e77f7b4e86775e53b5d3a0bef5abdb65 is-dotfile-1.0.2/000077500000000000000000000000001261134474400135575ustar00rootroot00000000000000is-dotfile-1.0.2/.editorconfig000066400000000000000000000004471261134474400162410ustar00rootroot00000000000000# http://editorconfig.org root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [test/fixtures/*] insert_final_newline = false trim_trailing_whitespace = false is-dotfile-1.0.2/.gitattributes000066400000000000000000000003551261134474400164550ustar00rootroot00000000000000# Enforce Unix newlines *.* text eol=lf *.css text eol=lf *.html text eol=lf *.js text eol=lf *.json text eol=lf *.less text eol=lf *.md text eol=lf *.yml text eol=lf *.jpg binary *.gif binary *.png binary *.jpeg binaryis-dotfile-1.0.2/.gitignore000066400000000000000000000001541261134474400155470ustar00rootroot00000000000000*.sublime-* _gh_pages actual bower_components node_modules npm-debug.log temp test/actual tmp TODO.md vendoris-dotfile-1.0.2/.jshintrc000066400000000000000000000004301261134474400154010ustar00rootroot00000000000000{ "asi": false, "boss": true, "curly": true, "eqeqeq": true, "eqnull": true, "esnext": true, "immed": true, "latedef": true, "laxcomma": false, "newcap": true, "noarg": true, "node": true, "sub": true, "undef": true, "unused": true, "mocha": true }is-dotfile-1.0.2/.verb.md000066400000000000000000000013321261134474400151140ustar00rootroot00000000000000# {%= name %} {%= badge("fury") %} > {%= description %} ## Install {%= include("install-npm", {save: true}) %} ## Usage ```js var isDotfile = require('{%= name %}'); ``` **false** All of the following return `false`: ```js isDotfile('a/b/c.js'); isDotfile('/.git/foo'); isDotfile('a/b/c/.git/foo'); //=> false ``` **true** All of the following return `true`: ```js isDotfile('a/b/.gitignore'); isDotfile('.gitignore'); isDotfile('/.gitignore'); //=> true ``` ## Related projects {%= related(verb.related.list) %} ## Running tests {%= include("tests") %} ## Contributing {%= include("contributing") %} ## Authors {%= include("author") %} ## License {%= copyright() %} {%= license() %} *** {%= include("footer") %} is-dotfile-1.0.2/LICENSE000066400000000000000000000020711261134474400145640ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015 Jon Schlinkert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. is-dotfile-1.0.2/README.md000066400000000000000000000036711261134474400150450ustar00rootroot00000000000000# is-dotfile [![NPM version](https://badge.fury.io/js/is-dotfile.svg)](http://badge.fury.io/js/is-dotfile) > Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory. ## Install Install with [npm](https://www.npmjs.com/) ```sh $ npm i is-dotfile --save ``` ## Usage ```js var isDotfile = require('is-dotfile'); ``` **false** All of the following return `false`: ```js isDotfile('a/b/c.js'); isDotfile('/.git/foo'); isDotfile('a/b/c/.git/foo'); //=> false ``` **true** All of the following return `true`: ```js isDotfile('a/b/.gitignore'); isDotfile('.gitignore'); isDotfile('/.gitignore'); //=> true ``` ## Related projects * [dotfile-regex](https://www.npmjs.com/package/dotfile-regex): Regular expresson for matching dotfiles. | [homepage](https://github.com/regexps/dotfile-regex) * [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob) * [is-dotdir](https://www.npmjs.com/package/is-dotdir): Returns true if a path is a dot-directory. | [homepage](https://github.com/jonschlinkert/is-dotdir) * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) ## Running tests Install dev dependencies: ```sh $ npm i -d && npm test ``` ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-dotfile/issues/new). ## Authors **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2015 Jon Schlinkert Released under the MIT license. *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 20, 2015._is-dotfile-1.0.2/benchmark/000077500000000000000000000000001261134474400155115ustar00rootroot00000000000000is-dotfile-1.0.2/benchmark/.gitignore000066400000000000000000000000131261134474400174730ustar00rootroot00000000000000*.DS_Store is-dotfile-1.0.2/benchmark/code/000077500000000000000000000000001261134474400164235ustar00rootroot00000000000000is-dotfile-1.0.2/benchmark/code/index-of.js000066400000000000000000000003571261134474400204770ustar00rootroot00000000000000 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; }; is-dotfile-1.0.2/benchmark/code/regex.js000077500000000000000000000001701261134474400200740ustar00rootroot00000000000000 var dotfileRe = require('dotfile-regex'); module.exports = function isDotfile(fp) { return dotfileRe().test(fp); }; is-dotfile-1.0.2/benchmark/fixtures/000077500000000000000000000000001261134474400173625ustar00rootroot00000000000000is-dotfile-1.0.2/benchmark/fixtures/is.js000077500000000000000000000000501261134474400203310ustar00rootroot00000000000000module.exports = ['a/b/c/d/.gitignore'];is-dotfile-1.0.2/benchmark/fixtures/long-not.js000066400000000000000000000001431261134474400214530ustar00rootroot00000000000000module.exports = ['a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/foo.gitignore'];is-dotfile-1.0.2/benchmark/fixtures/long.js000066400000000000000000000001401261134474400206520ustar00rootroot00000000000000module.exports = ['a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/a/b/c/d/.gitignore'];is-dotfile-1.0.2/benchmark/fixtures/not.js000077500000000000000000000000421261134474400205170ustar00rootroot00000000000000module.exports = ['a/b/c/d/e.js'];is-dotfile-1.0.2/benchmark/fixtures/start.js000066400000000000000000000000401261134474400210470ustar00rootroot00000000000000module.exports = ['.gitignore'];is-dotfile-1.0.2/benchmark/index.js000077500000000000000000000002571261134474400171650ustar00rootroot00000000000000'use strict'; var Suite = require('benchmarked'); var suite = new Suite({ result: true, fixtures: 'fixtures/*.js', add: 'code/*.js', cwd: __dirname }); suite.run();is-dotfile-1.0.2/index.js000066400000000000000000000006071261134474400152270ustar00rootroot00000000000000/*! * 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; }; is-dotfile-1.0.2/package.json000066400000000000000000000020101261134474400160360ustar00rootroot00000000000000{ "name": "is-dotfile", "description": "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.", "version": "1.0.2", "homepage": "https://github.com/jonschlinkert/is-dotfile", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", "repository": "jonschlinkert/is-dotfile", "bugs": { "url": "https://github.com/jonschlinkert/is-dotfile/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "devDependencies": { "benchmarked": "^0.1.3", "dotfile-regex": "^0.1.2", "mocha": "*" }, "keywords": [ "detect", "dot", "dotfile", "expression", "file", "filepath", "find", "fs", "is", "match", "path", "regex", "regexp", "regular" ], "verb": { "related": { "list": [ "has-glob", "is-glob", "dotfile-regex", "is-dotdir" ] } } } is-dotfile-1.0.2/test.js000066400000000000000000000016351261134474400151010ustar00rootroot00000000000000/*! * is-dotfile * * Copyright (c) 2015 Jon Schlinkert. * Licensed under the MIT License */ 'use strict'; /* deps: mocha */ var assert = require('assert'); var isDotfile = require('./'); it('should return false when the file is not a dotfile', function () { assert.equal(isDotfile('a/b/c/d/e.js'), false); assert.equal(isDotfile('a/b.c.d/e.js'), false); assert.equal(isDotfile('a/b.js'), false); assert.equal(isDotfile('a/.b/c/a.js'), false); assert.equal(isDotfile('.git/foo'), false); assert.equal(isDotfile('.gitignore/foo'), false); }); it('should return true when the file is a dotfile', function () { assert.equal(isDotfile('a/b/c/d/.gitignore'), true); assert.equal(isDotfile('a/.b/c/.gitignore'), true); assert.equal(isDotfile('a/.gitignore'), true); assert.equal(isDotfile('.gitignore'), true); assert.equal(isDotfile('/.gitignore'), true); });