File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 3
3
module . exports = match
4
4
5
5
var zwitch = require ( 'zwitch' )
6
- var pseudo = require ( './pseudo ' )
6
+ var needs = require ( './needs ' )
7
7
var test = require ( './test' )
8
8
var nest = require ( './nest' )
9
9
@@ -75,7 +75,7 @@ function configure(query, state) {
75
75
var index = - 1
76
76
77
77
while ( ++ index < pseudos . length ) {
78
- if ( pseudo . needsIndex . indexOf ( pseudos [ index ] . name ) > - 1 ) {
78
+ if ( needs . needsIndex . indexOf ( pseudos [ index ] . name ) > - 1 ) {
79
79
state . index = true
80
80
break
81
81
}
Original file line number Diff line number Diff line change
1
+ /* istanbul ignore file - Shouldn’t be invoked */
2
+ 'use strict'
3
+
4
+ module . exports = match
5
+
6
+ function match ( ) { }
7
+
8
+ match . needsIndex = [
9
+ 'first-child' ,
10
+ 'first-of-type' ,
11
+ 'last-child' ,
12
+ 'last-of-type' ,
13
+ 'nth-child' ,
14
+ 'nth-last-child' ,
15
+ 'nth-of-type' ,
16
+ 'nth-last-of-type' ,
17
+ 'only-child' ,
18
+ 'only-of-type'
19
+ ]
Original file line number Diff line number Diff line change @@ -9,19 +9,6 @@ var anything = require('./any')
9
9
10
10
var is = convert ( )
11
11
12
- match . needsIndex = [
13
- 'first-child' ,
14
- 'first-of-type' ,
15
- 'last-child' ,
16
- 'last-of-type' ,
17
- 'nth-child' ,
18
- 'nth-last-child' ,
19
- 'nth-of-type' ,
20
- 'nth-last-of-type' ,
21
- 'only-child' ,
22
- 'only-of-type'
23
- ]
24
-
25
12
var handle = zwitch ( 'name' , {
26
13
unknown : unknownPseudo ,
27
14
invalid : invalidPseudo ,
You can’t perform that action at this time.
0 commit comments