Skip to content

Commit

Permalink
Update star wars comic example
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairjcbrown committed Jan 24, 2019
1 parent 2235b5a commit a5bea7e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/find-new-star-wars-comics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ const data = [];
const filterUnwanted = function(list) {
const tradePaperback = " tp";
const hardCover = " hc";
const graphicNovel = " gn";
const boxSet = " box set";
const variant = " variant";
return _.filter(list, function({ name = "" }) {
return _.filter(list, function({ name = "", variantId }) {
const matches = name.match(/#\d+\w?(.*)?/i);
return (
!name.toLowerCase().endsWith(tradePaperback) &&
!name.toLowerCase().endsWith(hardCover) &&
!name.toLowerCase().endsWith(graphicNovel) &&
!name.toLowerCase().endsWith(boxSet) &&
!name.toLowerCase().endsWith(variant) &&
(_.isNull(matches) || _.isUndefined(matches[1]))
(_.isNull(matches) || _.isUndefined(matches[1])) &&
_.isNull(variantId)
);
});
};
Expand All @@ -37,7 +42,10 @@ const outputresults = function(list) {
["asc", "asc"]
);

console.log(JSON.stringify(mainIssues, null, 4));
// console.log(JSON.stringify(mainIssues, null, 4));
_.each(mainIssues, function({ releaseDate, name, url }) {
console.log(`[${releaseDate}] ${_.padEnd(name, 50)} -- ${url}`);
});
};

range.forEach(function(count) {
Expand Down

0 comments on commit a5bea7e

Please sign in to comment.