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

media-type

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

media-type - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

6

lib/mediaType.js

@@ -9,3 +9,3 @@ /**

var csv = require("binary-csv")("\n", ";");
var csv = require("binary-csv")({separator: ';'});

@@ -83,7 +83,7 @@ var MediaType = function() {

return (str.indexOf(";") > -1) ? '"' + str + '"' : str;
}
};
var unwrapQuotes = function(str) {
return (str.substr(0, 1) === '"' && str.substr(-1) === '"') ? str.substr(1, str.length - 2) : str;
}
};

@@ -90,0 +90,0 @@ var mediaTypeMatcher = /^(application|audio|image|message|model|multipart|text|video)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/;

{
"name": "media-type",
"version": "0.0.1",
"version": "0.0.2",
"main": "./lib/mediaType",

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

"dependencies": {
"binary-csv": "*"
"binary-csv": "~0.1"
}
}

@@ -84,3 +84,3 @@ /**

'text/"plain"',
"text/p�ain",
"text/p£ain",
"text/(plain)",

@@ -239,1 +239,16 @@ "text/@plain",

assert.strictEqual(type.toString(), "application/LD+JSON-SQL*CSV.1");
// https://github.com/lovell/media-type/issues/1
type = mediaType.fromString("image/svg+xml;charset=utf8;format=foo");
assert.ok(type.isValid());
assert.strictEqual(type.type, "image");
assert.strictEqual(type.subtype, "svg");
assert.ok(type.hasSuffix());
assert.strictEqual(type.suffix, "xml");
assert.deepEqual(type.subtypeFacets, ["svg"]);
assert.deepEqual(type.parameters, {"charset": "utf8", "format": "foo"});
assert.ok(!type.isVendor());
assert.ok(!type.isPersonal());
assert.ok(!type.isExperimental());
assert.strictEqual(type.toString(), "image/svg+xml;charset=utf8;format=foo");
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