forked from pattern-lab/patternlab-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessIterative.js
More file actions
24 lines (21 loc) · 879 Bytes
/
processIterative.js
File metadata and controls
24 lines (21 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';
const logger = require('./log');
const pph = require('./pseudopattern_hunter');
// This is now solely for analysis; loading of the pattern file is
// above, in loadPatternIterative()
module.exports = function(pattern, patternlab) {
//look for a pseudo pattern by checking if there is a file
//containing same name, with ~ in it, ending in .json
return pph
.find_pseudopatterns(pattern, patternlab)
.then(() => {
//find any stylemodifiers that may be in the current pattern
pattern.stylePartials = pattern.findPartialsWithStyleModifiers();
//find any pattern parameters that may be in the current pattern
pattern.parameteredPartials = pattern.findPartialsWithPatternParameters();
return Promise.resolve(pattern);
})
.catch(
logger.reportError('There was an error in processPatternIterative():')
);
};