File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ const pattern_assembler = function () {
8585 function addPattern ( pattern , patternlab ) {
8686
8787 //add the link to the global object
88+ if ( ! patternlab . data . link ) {
89+ patternlab . data . link = { } ;
90+ }
8891 patternlab . data . link [ pattern . patternPartial ] = '/patterns/' + pattern . patternLink ;
8992
9093 //only push to array if the array doesn't contain this pattern
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ module.exports = class PatternLab {
5353 // INITIALIZE EMPTY GLOBAL DATA STRUCTURES
5454 //
5555 this . data = { } ;
56- this . data . link = { } ;
5756 this . patterns = [ ] ;
5857 this . subtypePatterns = { } ;
5958 this . partials = { } ;
@@ -147,6 +146,7 @@ module.exports = class PatternLab {
147146 // data.json
148147 try {
149148 this . data = this . buildPatternData ( paths . source . data , fs ) ; // eslint-disable-line no-use-before-define
149+ this . data . link = { } ;
150150 } catch ( ex ) {
151151 logger . error ( 'missing or malformed' + paths . source . data + 'data.json Pattern Lab may not work without this file.' ) ;
152152 this . data = { } ;
You can’t perform that action at this time.
0 commit comments