@rane/web-auto-extractor
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -26,5 +26,6 @@ 'use strict'; | ||
// Not certain if decoding html entities from raw JSON is foolproof but | ||
// it seems to work | ||
var parsedJSON = JSON.parse(entities.decode(cleanedJson)); | ||
var parsedJSON = JSON.parse(cleanedJson); | ||
parsedJSON = mapValuesDeep(parsedJSON, function (val) { | ||
return entities.decode(val); | ||
}); | ||
if (!Array.isArray(parsedJSON)) { | ||
@@ -54,2 +55,16 @@ parsedJSON = [parsedJSON]; | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var mapValuesDeep = function mapValuesDeep(obj, fn) { | ||
return _lodash2.default.isArray(obj) ? _lodash2.default.map(obj, function (val) { | ||
return mapValuesDeep(val, fn); | ||
}) : _lodash2.default.mapValues(obj, function (val, key) { | ||
return _lodash2.default.isPlainObject(val) ? mapValuesDeep(val, fn) : fn(val, key, obj); | ||
}); | ||
}; | ||
var entities = new _htmlEntities.AllHtmlEntities(); |
{ | ||
"name": "@rane/web-auto-extractor", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Automatically extracts structured information from webpages", | ||
@@ -20,3 +20,4 @@ "main": "dist/index.js", | ||
"html-entities": "^1.2.1", | ||
"htmlparser2": "^3.9.1" | ||
"htmlparser2": "^3.9.1", | ||
"lodash": "^4.17.18" | ||
}, | ||
@@ -23,0 +24,0 @@ "devDependencies": { |
18509
285
4
+ Addedlodash@^4.17.18
+ Addedlodash@4.17.21(transitive)