Socket
Socket
Sign inDemoInstall

rss-parser

Package Overview
Dependencies
4
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.10.0 to 3.11.0

9

index.d.ts

@@ -46,2 +46,10 @@ import { Options } from 'xml2js';

export interface PaginationLinks {
self?: string;
first?: string;
next?: string;
last?: string;
prev?: string;
}
export interface Output<U> {

@@ -53,2 +61,3 @@ image?: {

},
paginationLinks?: PaginationLinks;
link?: string;

@@ -55,0 +64,0 @@ title?: string;

@@ -198,2 +198,6 @@ "use strict";

}
const paginationLinks = this.generatePaginationLinks(channel);
if (Object.keys(paginationLinks).length) {
feed.paginationLinks = paginationLinks;
}
utils.copyFromXML(channel, feed, feedFields);

@@ -313,4 +317,27 @@ feed.items = items.map(xmlItem => this.parseItemRss(xmlItem, itemFields));

}
/**
* Generates a pagination object where the rel attribute is the key and href attribute is the value
* { self: 'self-url', first: 'first-url', ... }
*
* @access private
* @param {Object} channel parsed XML
* @returns {Object}
*/
generatePaginationLinks(channel) {
if (!channel['atom:link']) {
return {};
}
const paginationRelAttributes = ['self', 'first', 'next', 'prev', 'last'];
return channel['atom:link'].reduce((paginationLinks, link) => {
if (!link.$ || !paginationRelAttributes.includes(link.$.rel)) {
return paginationLinks;
}
paginationLinks[link.$.rel] = link.$.href;
return paginationLinks;
}, {});
}
}
module.exports = Parser;

2

package.json
{
"name": "rss-parser",
"version": "3.10.0",
"version": "3.11.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc