Socket
Socket
Sign inDemoInstall

sdp

Package Overview
Dependencies
0
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.0 to 2.6.0

test/.eslintrc

2

package.json
{
"name": "sdp",
"version": "2.5.0",
"version": "2.6.0",
"description": "SDP parsing and serialization utilities",

@@ -5,0 +5,0 @@ "main": "sdp.js",

@@ -30,2 +30,15 @@ /* eslint-env node */

// returns the session description.
SDPUtils.getDescription = function(blob) {
var sections = SDPUtils.splitSections(blob);
return sections && sections[0];
};
// returns the individual media sections.
SDPUtils.getMediaSections = function(blob) {
var sections = SDPUtils.splitSections(blob);
sections.shift();
return sections;
};
// Returns lines that start with a certain prefix.

@@ -639,11 +652,24 @@ SDPUtils.matchPrefix = function(blob, prefix) {

var lines = SDPUtils.splitLines(mediaSection);
var mline = lines[0].split(' ');
var parts = lines[0].substr(2).split(' ');
return {
kind: mline[0].substr(2),
port: parseInt(mline[1], 10),
protocol: mline[2],
fmt: mline.slice(3).join(' ')
kind: parts[0],
port: parseInt(parts[1], 10),
protocol: parts[2],
fmt: parts.slice(3).join(' ')
};
};
SDPUtils.parseOLine = function(mediaSection) {
var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0];
var parts = line.substr(2).split(' ');
return {
username: parts[0],
sessionId: parts[1],
sessionVersion: parseInt(parts[2], 10),
netType: parts[3],
addressType: parts[4],
address: parts[5],
};
}
// Expose public methods.

@@ -650,0 +676,0 @@ if (typeof module === 'object') {

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