From 3dbf0a54c54263b677bbd22e9083d05eaeee4d56 Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Tue, 3 Nov 2020 10:46:06 +1100 Subject: [PATCH] Fix styled-components detection --- src/drivers/npm/driver.js | 1 + src/technologies.json | 22 +++++++++++++++------- src/wappalyzer.js | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index fb60c9b7f..f71298e0e 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -752,6 +752,7 @@ class Site { return reducedLinks } catch (error) { + console.log(error) if (error.constructor.name === 'TimeoutError') { throw new Error('The website took too long to respond') } diff --git a/src/technologies.json b/src/technologies.json index 2d78c75c1..7ceced10d 100644 --- a/src/technologies.json +++ b/src/technologies.json @@ -3273,7 +3273,7 @@ }, "icon": "commercejs.png", "scripts": [ - "https?:/cdn\\.chec\\.io/v(\\d+)/commerce\\.js\\;version=\\1", + "https?:/cdn\\.chec\\.io/v(\\d+)/commerce\\.js\\;version:\\1", "chec/commerce\\.js" ], "url": "^https?//.+\\.spaces.chec\\.io", @@ -16944,11 +16944,19 @@ 47 ], "description": "Styled components is a CSS-in-JS styling framework that uses tagged template literals in JavaScript.", - "html": [ - "]*data-styled(?:-components)?[\\s\"]", - "]+data-styled-version=\"([0-9]+)\"\\;version:\\1", - "<[^>]+sc-component-id: sc-" - ], + "dom": { + "style[data-styled], style[data-styled-components], [sc-component-id]": { + "text": "" + }, + "style[data-styled-version]": { + "attributes": { + "data-styled-version": "(^.+$)\\;version:\\1" + } + }, + "[sc-component-id]": { + "text": "" + } + }, "icon": "styled-components.png", "implies": "React", "js": { @@ -17173,4 +17181,4 @@ "website": "https://www.xt-commerce.com" } } -} \ No newline at end of file +} diff --git a/src/wappalyzer.js b/src/wappalyzer.js index ed63a161b..e51b464ec 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -431,7 +431,7 @@ const Wappalyzer = { patterns.forEach((_pattern) => { const pattern = (subtypes || []).reduce( - (pattern, subtype) => pattern[subtype], + (pattern, subtype) => pattern[subtype] || {}, _pattern )