mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Refactored UrlGenerator simplifying conditional logic
no issue - The logic inside the if/esle conditions was duplicated and made it confusing to reason about. - This change is not effecting the underlying logic at all
This commit is contained in:
parent
05e12d4b5a
commit
6268d9c324
1 changed files with 1 additions and 11 deletions
|
@ -161,17 +161,7 @@ class UrlGenerator {
|
|||
|
||||
// CASE 1: route has no custom filter, it will own the resource for sure
|
||||
// CASE 2: find out if my filter matches the resource
|
||||
if (!this.filter) {
|
||||
this.urls.add({
|
||||
url: url,
|
||||
generatorId: this.uid,
|
||||
resource: resource
|
||||
});
|
||||
|
||||
resource.reserve();
|
||||
this._resourceListeners(resource);
|
||||
return true;
|
||||
} else if (this.nql.queryJSON(resource.data)) {
|
||||
if ((!this.filter) || (this.nql.queryJSON(resource.data))) {
|
||||
this.urls.add({
|
||||
url: url,
|
||||
generatorId: this.uid,
|
||||
|
|
Loading…
Add table
Reference in a new issue