-
Notifications
You must be signed in to change notification settings - Fork 0
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
Left links overriding only for blocks of added or changed library versions #36
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,7 +328,38 @@ module.exports = function (target) { | |
return vow.resolve(target); | ||
} | ||
|
||
var languages = utility.getLanguages(); | ||
var languages = utility.getLanguages(), | ||
changedLibVersions = [] | ||
.concat(target.getChanges().getLibraries().getAdded()) | ||
.concat(target.getChanges().getLibraries().getModified()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а |
||
|
||
function isNeedToOverride(nodeValue) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Какого-нибудь бы сюда There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. неважно |
||
var route = nodeValue.route, | ||
conditions, | ||
lib, | ||
version; | ||
|
||
if(!route) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это когда такое может случится? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. так безопаснее |
||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. здесь нужен явный There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. явное лучше чем неявное |
||
} | ||
|
||
conditions = route.conditions; | ||
if(!conditions) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а это? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. и так тоже |
||
return false; | ||
} | ||
|
||
lib = conditions.lib; | ||
version = conditions.version; | ||
|
||
if(!lib || !version) { | ||
return false; | ||
} | ||
|
||
return changedLibVersions.some(function (item) { | ||
return item.lib === lib && item.version === version; | ||
}); | ||
} | ||
|
||
return vow.all([ | ||
levelDb.get().getByKeyRange(target.KEY.NODE_PREFIX, target.KEY.PEOPLE_PREFIX), | ||
collectUrls(target) | ||
|
@@ -338,6 +369,10 @@ module.exports = function (target) { | |
var nodeValue = nodeRecord.value; | ||
|
||
if (nodeValue.source && nodeValue.source.data) { | ||
if(!isNeedToOverride(nodeValue)) { | ||
return vow.resolve(); | ||
} | ||
|
||
return levelDb.get().get(nodeValue.source.data).then(function (blockValue) { | ||
if (!blockValue) { | ||
return vow.resolve(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
или здесь ради красоты 2 раза
concat
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да, для красоты