media-type
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -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" | ||
} |
0
27172
- Removedbinary-csv@^0.1.7
- Removedbinary-csv@0.1.7(transitive)
- Removedextend@1.2.1(transitive)
- Removedthrough@2.3.8(transitive)