Skip to content

Commit 74a3602

Browse files
committed
renamed stems to argv
1 parent 4b4f49b commit 74a3602

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎index.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Parth.prototype.boil = function (path, o){
3030

3131
o.input = (stem.string || util.fold(stem.array.join(' ')));
3232
o.path = o.input.replace(/[ ]+/g, ' ');
33-
o.stems = '';
33+
o.argv = '';
3434

3535
var url;
3636
if((url = o.path.match(/\/\S+/))){
@@ -46,9 +46,9 @@ Parth.prototype.boil = function (path, o){
4646
o.path = o.path.replace(o.url.href, o.url.pathname || '/');
4747
}
4848

49-
o.stems = o.path.replace(util.boilRE, '$& ').trim().split(/[ ]+/);
50-
o.index = o.depth = o.stems.length-1;
51-
return o.stems;
49+
o.argv = o.path.replace(util.boilRE, '$& ').trim().split(/[ ]+/);
50+
o.index = o.depth = o.argv.length-1;
51+
return o.argv;
5252
};
5353

5454
// ## Parth.set

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "parth",
33
"main": "index.js",
4-
"version": "1.1.6",
4+
"version": "1.2.0",
55
"engines": {
66
"node": ">= 0.9.0"
77
},

‎readme.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ parth
2727
// =>
2828
{ input: '/hello/awesome/10.10/?you=matter',
2929
path: '/hello/:there/:you(\\d+)',
30-
stems: ['/hello', '/awesome','/10.10'],
30+
argv: ['/hello', '/awesome','/10.10'],
3131
url:
3232
{ href: '/hello/awesome/10.10/?you=matter',
3333
hash: null,
@@ -49,7 +49,7 @@ parth
4949
// =>
5050
{ input: 'hello.awesome.human',
5151
path: 'hello.:there(\\w+).:you',
52-
stems: ['hello.', 'awesome.', 'human'],
52+
argv: ['hello.', 'awesome.', 'human'],
5353
depth: 2,
5454
regexp: /^hello\.(\w+)\.([^\. ]+)/i,
5555
notFound: false,
@@ -64,7 +64,7 @@ parth
6464
// =>
6565
{ input: '/hello/there/you/awesome',
6666
path: '/hello/:there/:you(\\w+)',
67-
stems: ['/hello', '/there', '/you', '/awesome'],
67+
argv: ['/hello', '/there', '/you', '/awesome'],
6868
url:
6969
{ href: '/hello/there/you/awesome',
7070
hash: null,
@@ -85,7 +85,7 @@ parth
8585
// =>
8686
{ input: 'get page.data /hello/there/awesome.json?page=10',
8787
path: ':method(get|put|delete|post) :model.data /hello/:one/:two',
88-
stems: ['get', 'page.', 'data', '/hello', '/there', '/awesome.json'],
88+
argv: ['get', 'page.', 'data', '/hello', '/there', '/awesome.json'],
8989
url:
9090
{ href: '/hello/there/awesome.json?page=10',
9191
hash: null,
@@ -123,7 +123,7 @@ arguments
123123
- `opts` type `object` holding all extra information
124124

125125
return
126-
- `opts.stems` array with the normalized path
126+
- `opts.argv` array with the normalized path
127127

128128
After the function call, all properties are available at the object passed to `opts`.
129129

@@ -164,7 +164,7 @@ return
164164
object with properties below
165165
- `input`: the given input
166166
- `path`: normalized path set (no querystring or hash and sanitized)
167-
- `stems`: `array` version of the normalized path
167+
- `argv`: `array` version of the normalized path
168168
- `url`: url contained in the matched path, object with properties
169169
- href: complete path
170170
- query: querystring without the '?' sign
@@ -188,7 +188,7 @@ parth
188188
console.log(op);
189189
{ input: 'my paths on fire',
190190
path: 'my paths on fire',
191-
stems: [ 'my', 'paths', 'on', 'fire' ],
191+
argv: [ 'my', 'paths', 'on', 'fire' ],
192192
depth: null,
193193
index: -1,
194194
found:

0 commit comments

Comments
 (0)