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

magicpen-media

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicpen-media - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

7

CHANGELOG.md

@@ -1,3 +0,8 @@

### v3.0.0 (2021-04-25)
### v3.0.1 (2021-04-25)
- [Tests: Also accept error messages referencing \/var\/folders so that the test suite works on a mac](https://github.com/unexpectedjs/magicpen-media/commit/a9c348a1eea6763d92167770f08b8df054d07455) ([Andreas Lind](mailto:andreas.lind@workday.com))
- [Fix browser support + broken test](https://github.com/unexpectedjs/magicpen-media/commit/d3d98ea9ff6b728978494e33b1d48306256d95df) ([Andreas Lind](mailto:andreas.lind@workday.com))
### v3.0.1 (2021-04-25)
#### Pull requests

@@ -4,0 +9,0 @@

9

lib/magicPenMedia.js

@@ -74,10 +74,13 @@ /* global Blob, btoa */

src = `data:${sanitizeContentType(contentType)};base64,`;
if (Buffer.isBuffer(media)) {
if (typeof Buffer === 'function' && Buffer.isBuffer(media)) {
src += media.toString('base64');
} else if (media instanceof Uint8Array) {
} else if (
media instanceof Uint8Array &&
typeof Buffer === 'function'
) {
src += Buffer.from(media).toString('base64');
} else if (typeof btoa === 'function') {
console.log('btoa');
src += btoa(media);
} else {
// Assume node.js <16 since btoa isn't available
src += Buffer.from(media).toString('base64');

@@ -84,0 +87,0 @@ }

{
"name": "magicpen-media",
"version": "3.0.1",
"version": "3.0.2",
"description": "Add media support to magicpen (images, audio, video)",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is too big to display

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