web-auto-extractor
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -16,5 +16,10 @@ 'use strict'; | ||
var parsedJSON = JSON.parse((0, _cheerio2.default)(item).text()); | ||
var type = parsedJSON['@type']; | ||
jsonldData[type] = jsonldData[type] || []; | ||
jsonldData[type].push(parsedJSON); | ||
if (!Array.isArray(parsedJSON)) { | ||
parsedJSON = [parsedJSON]; | ||
} | ||
parsedJSON.forEach(function (obj) { | ||
var type = obj['@type']; | ||
jsonldData[type] = jsonldData[type] || []; | ||
jsonldData[type].push(obj); | ||
}); | ||
} catch (e) { | ||
@@ -21,0 +26,0 @@ console.log('Error in jsonld parse - ' + e); |
{ | ||
"name": "web-auto-extractor", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Automatically extracts structured information from webpages", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
16483
254