Add support for version flag on implies

main
Elbert Alias 2 years ago
parent 83ecc0e205
commit f27604e81a

@ -157,6 +157,10 @@ Object.keys(technologies).forEach((name) => {
flags.forEach((flag) => { flags.forEach((flag) => {
const [key, value] = flag.split(':') const [key, value] = flag.split(':')
if (key === 'version') {
return
}
if (key === 'confidence') { if (key === 'confidence') {
if ( if (
!/^\d+$/.test(value) || !/^\d+$/.test(value) ||

@ -244,7 +244,8 @@ const Wappalyzer = {
done = true done = true
resolved.forEach(({ technology, confidence, lastUrl }) => { resolved.forEach(({ technology, confidence, lastUrl }) => {
technology.implies.forEach(({ name, confidence: _confidence }) => { technology.implies.forEach(
({ name, confidence: _confidence, version }) => {
const implied = Wappalyzer.getTechnology(name) const implied = Wappalyzer.getTechnology(name)
if (!implied) { if (!implied) {
@ -259,13 +260,14 @@ const Wappalyzer = {
resolved.push({ resolved.push({
technology: implied, technology: implied,
confidence: Math.min(confidence, _confidence), confidence: Math.min(confidence, _confidence),
version: '', version: version || '',
lastUrl, lastUrl,
}) })
done = false done = false
} }
}) }
)
}) })
} while (resolved.length && !done) } while (resolved.length && !done)
}, },
@ -389,9 +391,10 @@ const Wappalyzer = {
meta: transform(meta), meta: transform(meta),
scriptSrc: transform(scriptSrc), scriptSrc: transform(scriptSrc),
js: transform(js, true), js: transform(js, true),
implies: transform(implies).map(({ value, confidence }) => ({ implies: transform(implies).map(({ value, confidence, version }) => ({
name: value, name: value,
confidence, confidence,
version,
})), })),
excludes: transform(excludes).map(({ value }) => ({ excludes: transform(excludes).map(({ value }) => ({
name: value, name: value,