Socket
Socket
Sign inDemoInstall

blueimp-canvas-to-blob

Package Overview
Dependencies
0
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.17.0 to 3.18.0

18

js/canvas-to-blob.js

@@ -17,3 +17,3 @@ /*

;(function(window) {
;(function (window) {
'use strict'

@@ -25,3 +25,3 @@

window.Blob &&
(function() {
(function () {
try {

@@ -36,3 +36,3 @@ return Boolean(new Blob())

window.Uint8Array &&
(function() {
(function () {
try {

@@ -55,3 +55,3 @@ return new Blob([new Uint8Array(100)]).size === 100

window.Uint8Array &&
function(dataURI) {
function (dataURI) {
var matches,

@@ -102,5 +102,5 @@ mediaType,

if (CanvasPrototype.mozGetAsFile) {
CanvasPrototype.toBlob = function(callback, type, quality) {
CanvasPrototype.toBlob = function (callback, type, quality) {
var self = this
setTimeout(function() {
setTimeout(function () {
if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {

@@ -114,5 +114,5 @@ callback(dataURLtoBlob(self.toDataURL(type, quality)))

} else if (CanvasPrototype.toDataURL && dataURLtoBlob) {
CanvasPrototype.toBlob = function(callback, type, quality) {
CanvasPrototype.toBlob = function (callback, type, quality) {
var self = this
setTimeout(function() {
setTimeout(function () {
callback(dataURLtoBlob(self.toDataURL(type, quality)))

@@ -124,3 +124,3 @@ })

if (typeof define === 'function' && define.amd) {
define(function() {
define(function () {
return dataURLtoBlob

@@ -127,0 +127,0 @@ })

@@ -1,2 +0,2 @@

!function(t){"use strict";var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,f=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),b=f&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),d=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,B=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(f||d)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,o,n,r,a,i,l,u,c;if(!(e=t.match(B)))throw new Error("invalid data URI");for(o=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),n=!!e[4],r=t.slice(e[0].length),a=n?atob(r):decodeURIComponent(r),i=new ArrayBuffer(a.length),l=new Uint8Array(i),u=0;u<a.length;u+=1)l[u]=a.charCodeAt(u);return f?new Blob([b?l:i],{type:o}):((c=new d).append(i),c.getBlob(o))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(t,e,o){var n=this;setTimeout(function(){o&&r.toDataURL&&a?t(a(n.toDataURL(e,o))):t(n.mozGetAsFile("blob",e))})}:r.toDataURL&&a&&(r.toBlob=function(t,e,o){var n=this;setTimeout(function(){t(a(n.toDataURL(e,o)))})})),"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:t.dataURLtoBlob=a}(window);
!function(t){"use strict";var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,f=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),b=f&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),d=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,B=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(f||d)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,o,n,r,a,i,l,u,c;if(!(e=t.match(B)))throw new Error("invalid data URI");for(o=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),n=!!e[4],r=t.slice(e[0].length),a=(n?atob:decodeURIComponent)(r),i=new ArrayBuffer(a.length),l=new Uint8Array(i),u=0;u<a.length;u+=1)l[u]=a.charCodeAt(u);return f?new Blob([b?l:i],{type:o}):((c=new d).append(i),c.getBlob(o))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(t,e,o){var n=this;setTimeout(function(){o&&r.toDataURL&&a?t(a(n.toDataURL(e,o))):t(n.mozGetAsFile("blob",e))})}:r.toDataURL&&a&&(r.toBlob=function(t,e,o){var n=this;setTimeout(function(){t(a(n.toDataURL(e,o)))})})),"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:t.dataURLtoBlob=a}(window);
//# sourceMappingURL=canvas-to-blob.min.js.map
{
"name": "blueimp-canvas-to-blob",
"version": "3.17.0",
"version": "3.18.0",
"title": "JavaScript Canvas to Blob",

@@ -27,5 +27,5 @@ "description": "Canvas to Blob is a polyfill for the standard JavaScript canvas.toBlob method. It can be used to create Blob objects from an HTML canvas element.",

"eslint-config-prettier": "6",
"eslint-plugin-jsdoc": "15",
"eslint-plugin-jsdoc": "22",
"eslint-plugin-prettier": "3",
"prettier": "1",
"prettier": "2",
"uglify-js": "3"

@@ -48,5 +48,7 @@ },

"prettier": {
"arrowParens": "avoid",
"proseWrap": "always",
"semi": false,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none"
},

@@ -53,0 +55,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc