Skip to content

Commit fc01630

Browse files
committed
first commit
0 parents  commit fc01630

11 files changed

+481
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[test/fixtures/*]
16+
insert_final_newline = false
17+
trim_trailing_whitespace = false

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Enforce Unix newlines
2+
*.* text eol=lf
3+
*.css text eol=lf
4+
*.html text eol=lf
5+
*.js text eol=lf
6+
*.json text eol=lf
7+
*.less text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
11+
*.jpg binary
12+
*.gif binary
13+
*.png binary
14+
*.jpeg binary

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.sublime-*
2+
_gh_pages
3+
actual
4+
bower_components
5+
node_modules
6+
npm-debug.log
7+
temp
8+
test/actual
9+
tmp
10+
TODO.md
11+
vendor
12+
*.DS_Store

.jshintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"asi": false,
3+
"boss": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"eqnull": true,
7+
"esnext": true,
8+
"immed": true,
9+
"latedef": true,
10+
"laxcomma": false,
11+
"newcap": true,
12+
"noarg": true,
13+
"node": true,
14+
"sub": true,
15+
"undef": true,
16+
"unused": true,
17+
"mocha": true
18+
}

.npmignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.sublime-*
2+
_gh_pages
3+
actual
4+
bower_components
5+
node_modules
6+
npm-debug.log
7+
temp
8+
test/actual
9+
tmp
10+
TODO.md
11+
vendor
12+
*.DS_Store
13+
14+
# npmignore
15+
.*
16+
test.js
17+
test

.verb.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# {%= name %} {%= badge("fury") %}
2+
3+
> {%= description %}
4+
5+
{%= include("install-npm", {save: true}) %}
6+
7+
## Usage
8+
9+
```js
10+
var re = require('{%= name %}');
11+
12+
'a/b.c/d/e.min.js'.match(re());
13+
14+
//=> [0] 'a/b.c/d/e.min.js'
15+
//=> [1] 'a/b.c/d/'
16+
//=> [2] 'e.min.js'
17+
//=> [3] 'e'
18+
//=> [4] '.min.js'
19+
//=> [5] '.js'
20+
//=> [6] 'js'
21+
```
22+
23+
**Match groups**
24+
25+
- `[0]`: full path (`a/b.c/d/e.min.js`)
26+
- `[1]`: dirname (`a/b.c/d/`)
27+
- `[2]`: basename (with ext) (`e.min.js`)
28+
- `[3]`: filename (no ext) (`e`)
29+
- `[4]`: multi-extensions or extname (`.min.js`)
30+
- `[5]`: extname (with dot) (`.js`)
31+
- `[6]`: ext (no dot) (`js`)
32+
33+
34+
## Run tests
35+
36+
Install dev dependencies:
37+
38+
```bash
39+
node i -d && mocha
40+
```
41+
42+
## Contributing
43+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})
44+
45+
## Author
46+
47+
**Jon Schlinkert**
48+
49+
+ [github/jonschlinkert](https://github.com/jonschlinkert)
50+
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
51+
52+
## License
53+
{%= copyright() %}
54+
{%= license() %}
55+
56+
***
57+
58+
{%= include("footer") %}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2015 Jon Schlinkert
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# path-regex [![NPM version](https://badge.fury.io/js/path-regex.svg)](http://badge.fury.io/js/path-regex)
2+
3+
> Regular expression for matching the parts of a file path.
4+
5+
## Install with [npm](npmjs.org)
6+
7+
```bash
8+
npm i path-regex --save
9+
```
10+
11+
## Usage
12+
13+
```js
14+
var re = require('path-regex');
15+
16+
'a/b.c/d/e.min.js'.match(re());
17+
18+
//=> [0] 'a/b.c/d/e.min.js'
19+
//=> [1] 'a/b.c/d/'
20+
//=> [2] 'e.min.js'
21+
//=> [3] 'e'
22+
//=> [4] '.min.js'
23+
//=> [5] '.js'
24+
//=> [6] 'js'
25+
```
26+
27+
**Match groups**
28+
29+
- `[0]`: full path (`a/b.c/d/e.min.js`)
30+
- `[1]`: dirname (`a/b.c/d/`)
31+
- `[2]`: basename (with ext) (`e.min.js`)
32+
- `[3]`: filename (no ext) (`e`)
33+
- `[4]`: multi-extensions or extname (`.min.js`)
34+
- `[5]`: extname (with dot) (`.js`)
35+
- `[6]`: ext (no dot) (`js`)
36+
37+
38+
## Run tests
39+
40+
Install dev dependencies:
41+
42+
```bash
43+
node i -d && mocha
44+
```
45+
46+
## Contributing
47+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/regexps/path-regex/issues)
48+
49+
## Author
50+
51+
**Jon Schlinkert**
52+
53+
+ [github/jonschlinkert](https://github.com/jonschlinkert)
54+
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
55+
56+
## License
57+
Copyright (c) 2015 Jon Schlinkert
58+
Released under the MIT license
59+
60+
***
61+
62+
_This file was generated by [verb](https://github.com/assemble/verb) on January 13, 2015._

index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*!
2+
* path-regex <https://github.com/regexps/path-regex>
3+
*
4+
* Copyright (c) 2014-2015 Jon Schlinkert.
5+
* Licensed under the MIT license.
6+
*/
7+
8+
module.exports = function globPathRegex() {
9+
return /([\s\S]*?)(([^.,\\\/*]*|[.\\]?\{[^}]*\})((\.([^.,\\\/*]*))*)|$)$/;
10+
};

package.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "path-regex",
3+
"description": "Regular expression for matching the parts of a file path.",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/regexps/path-regex",
6+
"author": {
7+
"name": "Jon Schlinkert",
8+
"url": "https://github.com/jonschlinkert"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git://github.com/regexps/path-regex.git"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/regexps/path-regex/issues"
16+
},
17+
"license": {
18+
"type": "MIT",
19+
"url": "https://github.com/regexps/path-regex/blob/master/LICENSE-MIT"
20+
},
21+
"main": "index.js",
22+
"engines": {
23+
"node": ">=0.10.0"
24+
},
25+
"scripts": {
26+
"test": "mocha -R spec"
27+
},
28+
"devDependencies": {
29+
"mocha": "*"
30+
},
31+
"keywords": [
32+
"expression",
33+
"file",
34+
"filepath",
35+
"match",
36+
"matching",
37+
"path",
38+
"regex",
39+
"regexp",
40+
"regular"
41+
]
42+
}

0 commit comments

Comments
 (0)