metascraper-manifest 5.28.2 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -4
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { normalizeUrl, logo, composeRule } = require('@metascraper/helpers')
|
|
4
4
|
const asyncMemoizeOne = require('async-memoize-one')
|
|
5
|
-
const {
|
|
5
|
+
const { chain, toLower } = require('lodash')
|
|
6
6
|
const memoize = require('@keyvhq/memoize')
|
|
7
7
|
const got = require('got')
|
|
8
8
|
|
|
@@ -41,9 +41,16 @@ module.exports = opts => {
|
|
|
41
41
|
publisher: manifest({ from: 'short_name', to: 'publisher' }),
|
|
42
42
|
logo: async ({ htmlDom, url }) => {
|
|
43
43
|
const manifest = await toManifest(htmlDom, url)
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
44
|
+
|
|
45
|
+
const iconSrc = chain(manifest)
|
|
46
|
+
.get('icons')
|
|
47
|
+
.filter(icon => toLower(icon.purpose) !== 'monochrome')
|
|
48
|
+
.orderBy('sizes', 'desc')
|
|
49
|
+
.first()
|
|
50
|
+
.get('src')
|
|
51
|
+
.value()
|
|
52
|
+
|
|
53
|
+
return logo(iconSrc, { url })
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "metascraper-manifest",
|
|
3
3
|
"description": "Metascraper integration for derecting PWA Web app manifest",
|
|
4
4
|
"homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-manifest",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.29.0",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@keyvhq/memoize": "~1.6.6",
|
|
27
|
-
"@metascraper/helpers": "^5.
|
|
27
|
+
"@metascraper/helpers": "^5.29.0",
|
|
28
28
|
"async-memoize-one": "~1.1.0",
|
|
29
29
|
"got": "~11.8.3",
|
|
30
30
|
"lodash": "~4.17.21"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"slow": 300,
|
|
52
52
|
"timeout": "120000"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "86572d38b9d5de0af1608d1516756cc3ed5a43af"
|
|
55
55
|
}
|