@extractus/feed-extractor
Advanced tools
Comparing version 7.0.0 to 7.0.1
{ | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"name": "@extractus/feed-extractor", | ||
@@ -14,6 +14,3 @@ "description": "To read and normalize RSS/ATOM/JSON feed data", | ||
"imports": { | ||
"cross-fetch": "./src/deno/cross-fetch.js", | ||
"html-entities": "https://esm.sh/html-entities@2.4.0", | ||
"fast-xml-parser": "https://esm.sh/fast-xml-parser@4.2.5", | ||
"bellajs": "https://esm.sh/bellajs@11.1.2" | ||
"cross-fetch": "./src/deno/cross-fetch.js" | ||
}, | ||
@@ -38,10 +35,10 @@ "browser": { | ||
"cross-fetch": "^4.0.0", | ||
"fast-xml-parser": "^4.2.5", | ||
"fast-xml-parser": "^4.2.6", | ||
"html-entities": "^2.4.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.44.0", | ||
"eslint": "^8.45.0", | ||
"https-proxy-agent": "^7.0.1", | ||
"jest": "^29.6.1", | ||
"nock": "^13.3.1" | ||
"nock": "^13.3.2" | ||
}, | ||
@@ -48,0 +45,0 @@ "keywords": [ |
@@ -126,3 +126,3 @@ # feed-extractor | ||
- `useISODateFormat`: Boolean, convert datetime to ISO format. Default `true`. | ||
- `descriptionMaxLen`: Number, to truncate description. Default `210` (characters). | ||
- `descriptionMaxLen`: Number, to truncate description. Default `250` characters. Set to `0` = no truncation. | ||
- `xmlParserOptions`: Object, used by xml parser, view [fast-xml-parser's docs](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md) | ||
@@ -129,0 +129,0 @@ - `getExtraFeedFields`: Function, to get more fields from feed data |
@@ -14,3 +14,3 @@ // main.js | ||
normalization = true, | ||
descriptionMaxLen = 210, | ||
descriptionMaxLen = 250, | ||
useISODateFormat = true, | ||
@@ -17,0 +17,0 @@ xmlParserOptions = {}, |
@@ -24,5 +24,6 @@ // normalizer | ||
export const buildDescription = (val, maxlen) => { | ||
export const buildDescription = (val, maxlen = 0) => { | ||
const stripped = stripTags(String(val)) | ||
return truncate(stripped, maxlen).replace(/\n+/g, ' ') | ||
const text = maxlen > 0 ? truncate(stripped, maxlen) : stripped | ||
return text.replace(/\n+/g, ' ') | ||
} | ||
@@ -29,0 +30,0 @@ |
1516
58955
Updatedfast-xml-parser@^4.2.6