Skip to content

Commit c10247c

Browse files
committed
refactor: remove parameter hunter
1 parent 885c235 commit c10247c

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

packages/core/src/lib/expandPartials.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,6 @@ module.exports = function (currentPattern, patternlab) {
1919
foundPatternPartials.length > 0
2020
) {
2121
logger.debug(`found partials for ${currentPattern.patternPartial}`);
22-
23-
// determine if the template contains any pattern parameters. if so they
24-
// must be immediately consumed
25-
return parameter_hunter
26-
.find_parameters(currentPattern, patternlab)
27-
.then(() => {
28-
//do something with the regular old partials
29-
foundPatternPartials.forEach((foundPartial) => {
30-
const partial = currentPattern.findPartial(foundPartial);
31-
const partialPattern = getPartial(partial, patternlab);
32-
33-
//recurse through nested partials to fill out this extended template.
34-
return processRecursive(partialPattern.relPath, patternlab)
35-
.then(() => {
36-
//eslint-disable-line no-loop-func
37-
38-
//complete assembly of extended template
39-
//create a copy of the partial so as to not pollute it after the getPartial call.
40-
const cleanPartialPattern = jsonCopy(
41-
partialPattern,
42-
`partial pattern ${partial}`
43-
);
44-
45-
//this is what we came here for
46-
logger.debug(
47-
`within ${currentPattern.patternPartial}, replacing extendedTemplate partial ${foundPartial} with ${cleanPartialPattern.patternPartial}'s extendedTemplate`
48-
);
49-
50-
currentPattern.extendedTemplate =
51-
currentPattern.extendedTemplate.replace(
52-
foundPartial,
53-
cleanPartialPattern.extendedTemplate
54-
);
55-
56-
// update the extendedTemplate in the partials object in case this
57-
// pattern is consumed later
58-
patternlab.partials[currentPattern.patternPartial] =
59-
currentPattern.extendedTemplate;
60-
61-
return Promise.resolve();
62-
})
63-
.catch((reason) => {
64-
console.log(reason);
65-
logger.error(reason);
66-
});
67-
});
68-
})
69-
.catch((reason) => {
70-
console.log(reason);
71-
logger.error(reason);
72-
});
7322
}
7423
return Promise.resolve();
7524
};

0 commit comments

Comments
 (0)