@metascraper/helpers 5.28.9 → 5.29.3
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 +10 -5
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -8,11 +8,11 @@ const {
|
|
|
8
8
|
includes,
|
|
9
9
|
invoke,
|
|
10
10
|
isArray,
|
|
11
|
+
isBoolean,
|
|
12
|
+
isDate,
|
|
11
13
|
isEmpty,
|
|
12
14
|
isNumber,
|
|
13
|
-
isBoolean,
|
|
14
15
|
isString,
|
|
15
|
-
isDate,
|
|
16
16
|
lte,
|
|
17
17
|
replace,
|
|
18
18
|
size,
|
|
@@ -299,13 +299,18 @@ memoizeOne.EqualityUrlAndHtmlDom = (newArgs, oldArgs) =>
|
|
|
299
299
|
const jsonld = memoizeOne(
|
|
300
300
|
$ =>
|
|
301
301
|
$('script[type="application/ld+json"]')
|
|
302
|
-
.map((
|
|
302
|
+
.map(function () {
|
|
303
303
|
try {
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
const el = $(this)
|
|
305
|
+
const json = JSON.parse(
|
|
306
|
+
$(el)
|
|
306
307
|
.contents()
|
|
307
308
|
.text()
|
|
308
309
|
)
|
|
310
|
+
|
|
311
|
+
const { '@graph': graph, ...props } = json
|
|
312
|
+
if (!graph) return json
|
|
313
|
+
return graph.map(item => ({ ...props, ...item }))
|
|
309
314
|
} catch (_) {
|
|
310
315
|
return undefined
|
|
311
316
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@metascraper/helpers",
|
|
3
3
|
"description": "Collection of helper functions used by metascraper",
|
|
4
4
|
"homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-helpers",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.29.3",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"audio-extensions": "0.0.0",
|
|
26
26
|
"chrono-node": "2.3.8",
|
|
27
27
|
"condense-whitespace": "~2.0.0",
|
|
28
|
-
"entities": "~4.
|
|
28
|
+
"entities": "~4.3.0",
|
|
29
29
|
"file-extension": "~4.0.5",
|
|
30
30
|
"has-values": "~2.0.1",
|
|
31
31
|
"image-extensions": "~1.1.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "e3d5ef5add6fec690b1234e6aaa273e1a658c256"
|
|
67
67
|
}
|