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

m3u-parser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

m3u-parser - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

.idea/encodings.xml

8

m3u.js

@@ -27,3 +27,3 @@ var Promise = require('bluebird');

} else if (line.slice(0, 7) === '#EXTINF') {
var result = /^#EXTINF:(\d+),(.*)$/.exec(line);
var result = /^#EXTINF:(-?)(\d+),(.*)$/.exec(line);
if (!result)

@@ -33,4 +33,4 @@ throw new Error('Invalid M3U format');

buffer.push({
title: result[2].trim(),
duration: +(result[1].trim())
title: result[3].trim(),
duration: +(result[1] + result[2].trim())
});

@@ -48,2 +48,2 @@

module.exports.parse = parse;
module.exports.parse = parse;
{
"name": "m3u-parser",
"version": "1.0.2",
"version": "1.0.3",
"description": "Simple library for hassle-free M3U playlists parsing",

@@ -19,12 +19,12 @@ "main": "m3u.js",

"bugs": "https://github.com/v12/m3u-parser/issues",
"license": "GPLv3",
"license": "ISC",
"dependencies": {
"bluebird": "^2.9.24"
"bluebird": "^3.1.1"
},
"devDependencies": {
"chai": "^2.3.0",
"chai": "^3.4.1",
"chai-as-promised": "^5.0.0",
"istanbul": "^0.3.14",
"istanbul": "^0.4.1",
"mocha": "^2.2.5"
}
}

@@ -0,0 +0,0 @@ # M3U Parser

@@ -13,10 +13,13 @@ 'use strict';

var files = [fs.readFileSync(__dirname + '/playlists/extended.m3u')];
var files = ['extended', 'invalid_extended']
.map(function (filename) { return fs.readFileSync(__dirname + '/playlists/' + filename + '.m3u'); });
describe('M3U playlist parser', function () {
it('should be rejeceted when invalid data passed', function () {
it('should be rejected when invalid data passed', function () {
return Promise.all([
m3u.parse().should.eventually.be.rejected,
m3u.parse(123).should.eventually.be.rejected,
m3u.parse('invalid').should.eventually.be.rejected
m3u.parse('invalid').should.eventually.be.rejected,
m3u.parse(files[1]).should.eventually.be.rejected,
m3u.parse('#EXTM3U\n\ninvalid').should.eventually.be.rejected
]);

@@ -31,3 +34,3 @@ });

data.should.be.an.instanceOf(Array),
data.should.have.length(4),
data.should.have.length(5),
data[0].should.be.an('object'),

@@ -40,4 +43,9 @@ data[0].should.have.all.keys('file', 'title', 'duration'),

});
})
});
it('should parse negative duration properly', function () {
return m3u.parse(files[ 0 ]).should.be.eventually.fulfilled
.and.have.deep.property('[4].duration', -1);
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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