Socket
Socket
Sign inDemoInstall

media-type

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

8

lib/mediaType.js

@@ -9,4 +9,2 @@ /**

var csv = require("binary-csv")({separator: ';'});
var MediaType = function() {

@@ -90,2 +88,4 @@ this.type = null;

var parameterSplitter = /;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;
exports.fromString = function(str) {

@@ -99,4 +99,4 @@ var mediaType = new MediaType();

if (match[3]) {
csv.line(new Buffer(match[3])).forEach(function(parameter) {
var keyAndValue = csv.cell(parameter).toString().split("=", 2);
match[3].substr(1).split(parameterSplitter).forEach(function(parameter) {
var keyAndValue = parameter.split('=', 2);
if (keyAndValue.length === 2) {

@@ -103,0 +103,0 @@ mediaType.parameters[keyAndValue[0].toLowerCase().trim()] = unwrapQuotes(keyAndValue[1].trim());

{
"name": "media-type",
"version": "0.1.0",
"version": "0.2.0",
"main": "./lib/mediaType",

@@ -28,6 +28,3 @@ "description": "Parse and validate RFC6838 media types, anything from 'text/plain' to 'application/vnd.company.app.entity-v2+xml;charset=utf8'",

"author": "Lovell Fuller",
"license": "Apache 2.0",
"dependencies": {
"binary-csv": "^0.1.7"
}
"license": "Apache 2.0"
}
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