Skip to content

Commit

Permalink
Merge pull request #283 from ninoseki/refactoring
Browse files Browse the repository at this point in the history
refactor: remove xmr selecton
  • Loading branch information
ninoseki authored Aug 16, 2019
2 parents de78c98 + 4a914b9 commit c7422e5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/lib/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export class Selector {
}

public getSearchersByType(type: SearchableType): Searcher[] {
return this.searchers.filter(
(searcher: Searcher) => searcher.supportedTypes.includes(type)
return this.searchers.filter((searcher: Searcher) =>
searcher.supportedTypes.includes(type)
);
}

Expand Down Expand Up @@ -101,6 +101,7 @@ export class Selector {
this.makeAnalyzerEntries(this.getSearchersByType("asn"), "asn", asn)
);
}

const email = this.getEmail();
if (email !== null) {
return this.concat(
Expand All @@ -112,13 +113,15 @@ export class Selector {
)
);
}

const url = this.getURL();
if (url !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("url"), "url", url)
);
}

const domain = this.getDomain();
if (domain !== null) {
return this.concat(
Expand All @@ -130,41 +133,39 @@ export class Selector {
)
);
}

const ip = this.getIP();
if (ip !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("ip"), "ip", ip)
);
}

const hash = this.getHash();
if (hash !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("hash"), "hash", hash)
);
}

const cve = this.getCVE();
if (cve !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("cve"), "cve", cve)
);
}

const btc = this.getBTC();
if (btc !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("btc"), "btc", btc)
);
}
const xmr = this.getXMR();
if (xmr !== null) {
return this.concat(
entries,
this.makeAnalyzerEntries(this.getSearchersByType("xmr"), "xmr", xmr)
);
}

const gaTrackID = this.getGATrackID();
if (gaTrackID !== null) {
return this.concat(
Expand All @@ -176,6 +177,7 @@ export class Selector {
)
);
}

const gaPubID = this.getGAPubID();
if (gaPubID !== null) {
return this.concat(
Expand All @@ -187,6 +189,7 @@ export class Selector {
)
);
}

return entries;
}

Expand Down

0 comments on commit c7422e5

Please sign in to comment.