magicpen-media
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -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 @@ |
@@ -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
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
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
697574
19342