Skip to content

Add retrieval for pattern order by prefixes to ensure previous behavior #1281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/core/src/lib/object_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,19 @@ const Pattern = function(
this.patternGroupData.order = info.patternSubgroupOrder;
}

// TODO: Remove the following when ordering by file prefix gets obsolete
if (prefixMatcherDeprecationCheckOrder.test(this.fileName)) {
if (this.fileName.indexOf('~') === -1) {
this.order = this.setPatternOrderDataForInfo(this.fileName);
} else {
this.variantOrder = this.setPatternOrderDataForInfo(this.fileName);
}
}

/**
* Determines if this pattern needs to be recompiled.
*
* @ee {@link CompileState}*/
* @see {@link CompileState}*/
this.compileState = null;

/**
Expand Down Expand Up @@ -371,12 +380,14 @@ Pattern.prototype = {
.split(/\/|\\/, 2)
.map((o, i) => {
if (i === 0) {
// TODO: Remove when prefix gets deprecated
info.patternGroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
o
);
}

if (i === 1) {
// TODO: Remove when prefix gets deprecated
info.patternSubgroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
o
);
Expand Down