@transcend-io/penumbra
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -7,2 +7,3 @@ "use strict"; | ||
const MEDIA_TYPES = ['image', 'video', 'audio']; | ||
const TEXT_TYPES = /^\s*(?:text\/\S*|application\/(?:xml|json)|\S*\/\S*\+xml|\S*\/\S*\+json)\s*(?:$|;)/i; | ||
/** | ||
@@ -18,3 +19,6 @@ * Get the contents of an encrypted file | ||
// Return the decrypted content | ||
const type = resource.mimetype.split('/')[0]; | ||
const type = resource.mimetype | ||
.split('/')[0] | ||
.trim() | ||
.toLowerCase(); | ||
if (!alwaysBlob) { | ||
@@ -24,3 +28,3 @@ if (MEDIA_TYPES.includes(type)) { | ||
} | ||
if (type === 'text' || resource.mimetype === 'application/json') { | ||
if (type === 'text' || TEXT_TYPES.test(resource.mimetype)) { | ||
return utils_1.getTextFromRS(rs); | ||
@@ -27,0 +31,0 @@ } |
{ | ||
"name": "@transcend-io/penumbra", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Crypto streams for the browser.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -7,2 +7,3 @@ // local | ||
const MEDIA_TYPES = ['image', 'video', 'audio']; | ||
const TEXT_TYPES = /^\s*(?:text\/\S*|application\/(?:xml|json)|\S*\/\S*\+xml|\S*\/\S*\+json)\s*(?:$|;)/i; | ||
@@ -23,3 +24,6 @@ /** | ||
// Return the decrypted content | ||
const type = resource.mimetype.split('/')[0]; | ||
const type = resource.mimetype | ||
.split('/')[0] | ||
.trim() | ||
.toLowerCase(); | ||
if (!alwaysBlob) { | ||
@@ -29,3 +33,3 @@ if (MEDIA_TYPES.includes(type)) { | ||
} | ||
if (type === 'text' || resource.mimetype === 'application/json') { | ||
if (type === 'text' || TEXT_TYPES.test(resource.mimetype)) { | ||
return getTextFromRS(rs); | ||
@@ -32,0 +36,0 @@ } |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1313
164451