Skip to content

Commit 4b81395

Browse files
changed to an if statement instead of shorthand to pass 'pretty' test
1 parent d85d912 commit 4b81395

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/lib/object_factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ const Pattern = function(relPath, data, patternlab) {
3535
this.relPath = path.normalize(relPath); // '00-atoms/00-global/00-colors.mustache'
3636
this.fileName = pathObj.name; // '00-colors'
3737
this.subdir = pathObj.dir; // '00-atoms/00-global'
38-
this.subdir = (this.subdir.match(/\w(?=\\)|\w(?=\/)/g) || []).length > 1 ? this.subdir.split(/\/|\\/, 2).join(path.sep) : this.subdir; // '00-atoms/03-controls/00-button' -> '00-atoms/00-global'
38+
if((this.subdir.match(/\w(?=\\)|\w(?=\/)/g) || []).length > 1){
39+
this.subdir = this.subdir.split(/\/|\\/, 2).join(path.sep); // '00-atoms/03-controls/00-button' -> '00-atoms/00-global'
40+
}
3941
this.fileExtension = pathObj.ext; // '.mustache'
4042

4143
// this is the unique name, subDir + fileName (sans extension)

0 commit comments

Comments
 (0)