web-auto-extractor
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -101,9 +101,22 @@ 'use strict'; | ||
} else if (attribs[PROP]) { | ||
if (currentScope[attribs[PROP]] && !Array.isArray(currentScope[attribs[PROP]])) { | ||
// PROP occurs for the second time, storing it as an array | ||
currentScope[attribs[PROP]] = [currentScope[attribs[PROP]]]; | ||
} | ||
var value = getPropValue(tagName, attribs, TYPE, PROP); | ||
if (!value) { | ||
tag = PROP; | ||
currentScope[attribs[PROP]] = ''; | ||
if (Array.isArray(currentScope[attribs[PROP]])) { | ||
currentScope[attribs[PROP]].push(''); | ||
} else { | ||
currentScope[attribs[PROP]] = ''; | ||
} | ||
textForProp = attribs[PROP]; | ||
} else { | ||
currentScope[attribs[PROP]] = value; | ||
if (Array.isArray(currentScope[attribs[PROP]])) { | ||
currentScope[attribs[PROP]].push(value); | ||
} else { | ||
currentScope[attribs[PROP]] = value; | ||
} | ||
} | ||
@@ -116,3 +129,7 @@ } | ||
if (textForProp) { | ||
scopes[scopes.length - 1][textForProp] += text.trim(); | ||
if (Array.isArray(scopes[scopes.length - 1][textForProp])) { | ||
scopes[scopes.length - 1][textForProp][scopes[scopes.length - 1][textForProp].length - 1] += text.trim(); | ||
} else { | ||
scopes[scopes.length - 1][textForProp] += text.trim(); | ||
} | ||
} | ||
@@ -119,0 +136,0 @@ }; |
{ | ||
"name": "web-auto-extractor", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Automatically extracts structured information from webpages", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16342
249
0