Skip to content

Commit 53393ba

Browse files
committed
chore(patternlab): Move initialization of data structure into constructor
1 parent 726427a commit 53393ba

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

core/lib/patternlab.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ module.exports = class PatternLab {
4848
this.engines = patternEngines;
4949
this.engines.loadAllEngines(config);
5050

51+
//
52+
// INITIALIZE EMPTY GLOBAL DATA STRUCTURES
53+
//
54+
this.data = {};
55+
this.data.link = {};
56+
this.patterns = [];
57+
this.subtypePatterns = {};
58+
this.partials = {};
59+
5160
// Cache the package.json in RAM
5261
this.package = fs.readJSONSync(path.resolve(__dirname, '../../package.json'));
5362

@@ -166,15 +175,6 @@ module.exports = class PatternLab {
166175
process.exit(1);
167176
}
168177

169-
170-
//
171-
// INITIALIZE EMPTY GLOBAL DATA STRUCTURES
172-
//
173-
this.patterns = [];
174-
this.subtypePatterns = {};
175-
this.partials = {};
176-
this.data.link = {};
177-
178178
this.setCacheBust();
179179

180180
pattern_assembler.combine_listItems(this);

0 commit comments

Comments
 (0)