File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const logger = require ( './log' ) ;
4
4
const decompose = require ( './decompose' ) ;
5
+ const getPartial = require ( './get' ) ;
5
6
6
7
module . exports = function ( file , patternlab ) {
7
8
8
- console . log ( 8 , file )
9
-
10
9
//find current pattern in patternlab object using file as a partial
11
- var currentPattern , i ;
12
-
13
- for ( i = 0 ; i < patternlab . patterns . length ; i ++ ) {
14
- if ( patternlab . patterns [ i ] . relPath === file ) {
15
- currentPattern = patternlab . patterns [ i ] ;
16
- }
17
- }
10
+ var currentPattern = getPartial ( file , patternlab ) ;
18
11
19
12
//return if processing an ignored file
20
13
if ( typeof currentPattern === 'undefined' ) { return Promise . resolve ( ) ; }
21
14
22
15
//we are processing a markdown only pattern
23
16
if ( currentPattern . engine === null ) { return Promise . resolve ( ) ; }
24
17
25
- console . log ( 25 , currentPattern . patternPartial )
26
-
27
18
//call our helper method to actually unravel the pattern with any partials
28
19
return decompose ( currentPattern , patternlab )
29
20
. catch ( reason => {
You can’t perform that action at this time.
0 commit comments