Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

feedparser

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feedparser - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

test.js

5

History.md
2.1.0 / 2017-01-18
==================
* Keep optional media:content attributes in the enclosures default property
2.0.0 / 2016-12-26

@@ -3,0 +8,0 @@ ==================

23

lib/feedparser/index.js

@@ -917,2 +917,3 @@ /**********************************************************************

case('media:content'):
var optionalAttributes = ['bitrate', 'framerate', 'samplingrate', 'duration', 'height', 'width'];
if (Array.isArray(el)) {

@@ -924,3 +925,12 @@ el.forEach(function (enc){

enclosure.length = _.get(enc['@'], 'filesize');
if (indexOfObject(item.enclosures, enclosure, ['url', 'type']) === -1) {
var index = indexOfObject(item.enclosures, enclosure, ['url', 'type']);
if (index !== -1) {
enclosure = item.enclosures[index];
}
optionalAttributes.forEach(function (attribute) {
if (!enclosure[attribute] && _.get(enc['@'], attribute)) {
enclosure[attribute] = _.get(enc['@'], attribute);
}
});
if (index === -1) {
item.enclosures.push(enclosure);

@@ -934,3 +944,12 @@ }

enclosure.length = _.get(el['@'], 'filesize');
if (indexOfObject(item.enclosures, enclosure, ['url', 'type']) === -1) {
var index = indexOfObject(item.enclosures, enclosure, ['url', 'type']);
if (index !== -1) {
enclosure = item.enclosures[index];
}
optionalAttributes.forEach(function (attribute) {
if (!enclosure[attribute] && _.get(el['@'], attribute)) {
enclosure[attribute] = _.get(el['@'], attribute);
}
});
if (index === -1) {
item.enclosures.push(enclosure);

@@ -937,0 +956,0 @@ }

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "2.0.0",
"version": "2.1.0",
"keywords": [

@@ -11,0 +11,0 @@ "rss",

@@ -9,3 +9,22 @@ describe('duplicate enclosures', function(){

var stream = this;
assert.strictEqual(stream.read().enclosures.length, 2);
var enclosures = stream.read().enclosures;
assert.strictEqual(enclosures.length, 3);
assert.deepEqual(enclosures, [{
url: 'http://i.mol.im/i/pix/2013/02/03/article-2272640-174FCEE2000005DC-697_154x115.jpg',
type: 'image/jpeg',
length: '4114',
height: '115',
width: '154'
}, {
url: 'http://i.mol.im/i/pix/2013/02/03/article-2272640-174FCEE2000005DC-697_154x115.mp4',
type: 'video/mp4',
length: '4114'
}, {
url: 'http://i.mol.im/i/pix/2013/02/03/article-2272640-174FCEE2000005DC-697.mp4',
type: 'video/mp4',
length: null,
bitrate: '3000',
height: '115',
width: '154'
}]);
done();

@@ -12,0 +31,0 @@ })

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc