Skip to content

Commit c706267

Browse files
committed
refactor(processRecursive): Use getPartial
1 parent 3fe17e5 commit c706267

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

core/lib/processRecursive.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@
22

33
const logger = require('./log');
44
const decompose = require('./decompose');
5+
const getPartial = require('./get');
56

67
module.exports = function (file, patternlab) {
78

8-
console.log(8, file)
9-
109
//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);
1811

1912
//return if processing an ignored file
2013
if (typeof currentPattern === 'undefined') { return Promise.resolve(); }
2114

2215
//we are processing a markdown only pattern
2316
if (currentPattern.engine === null) { return Promise.resolve(); }
2417

25-
console.log(25, currentPattern.patternPartial)
26-
2718
//call our helper method to actually unravel the pattern with any partials
2819
return decompose(currentPattern, patternlab)
2920
.catch(reason => {

0 commit comments

Comments
 (0)