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

blobjs

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

blobjs - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

Blob.js

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

/* Blob.js v1.1.0
/*! Blob.js v1.1.1
*

@@ -227,3 +227,3 @@ * native Blob interface support (polyfill)

Blob.prototype = getPrototypeOf(new view.Blob());
Blob.prototype = getPrototypeOf(new window.Blob());

@@ -230,0 +230,0 @@ if (typeof define === "function" && define.amd) {

@@ -1,5 +0,6 @@

/* Blob.js v1.1.0
/*! Blob.js v1.1.1
*
* native Blob interface support (polyfill)
*
* By Travis Clarke, https://travismclarke.com
* By Eli Grey, http://eligrey.com

@@ -11,2 +12,2 @@ * By Devin Samarin, https://github.com/dsamarin

*/
(function(root,factory){if(typeof exports==="object"&&typeof exports.nodeName!=="string"){module.exports=root.document?factory(root,true):function(w){if(!w.document){throw new Error("blobjs requires a window with a document")}return factory(w)}}else{factory(root)}})(window||this,function(window,noGlobal){"use strict";var is_safari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);window.URL=window.URL||window.webkitURL;if(window.Blob&&window.URL&&!is_safari){try{new window.Blob;if(typeof define==="function"&&define.amd){define("blobjs",[],function(){return window.Blob})}return window.Blob}catch(e){}}var BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||function(window){var get_class=function(object){return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]},FakeBlobBuilder=function BlobBuilder(){this.data=[]},FakeBlob=function Blob(data,type,encoding){this.data=data;this.size=data.length;this.type=type;this.encoding=encoding},FBB_proto=FakeBlobBuilder.prototype,FB_proto=FakeBlob.prototype,FileReaderSync=window.FileReaderSync,FileException=function(type){this.code=this[this.name=type]},file_ex_codes=("NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "+"NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR").split(" "),file_ex_code=file_ex_codes.length,real_URL=window.URL||window.webkitURL||window,real_create_object_URL=real_URL.createObjectURL,real_revoke_object_URL=real_URL.revokeObjectURL,URL=real_URL,btoa=window.btoa,atob=window.atob,ArrayBuffer=window.ArrayBuffer,Uint8Array=window.Uint8Array,origin=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;FakeBlob.fake=FB_proto.fake=true;while(file_ex_code--){FileException.prototype[file_ex_codes[file_ex_code]]=file_ex_code+1}if(!real_URL.createObjectURL){URL=window.URL=function(uri){var uri_info=document.createElementNS("http://www.w3.org/1999/xhtml","a"),uri_origin;uri_info.href=uri;if(!("origin"in uri_info)){if(uri_info.protocol.toLowerCase()==="data:"){uri_info.origin=null}else{uri_origin=uri.match(origin);uri_info.origin=uri_origin&&uri_origin[1]}}return uri_info}}URL.createObjectURL=function(blob){var type=blob.type,data_URI_header;if(type===null){type="application/octet-stream"}if(blob instanceof FakeBlob){data_URI_header="data:"+type;if(blob.encoding==="base64"){return data_URI_header+";base64,"+blob.data}else if(blob.encoding==="URI"){return data_URI_header+","+decodeURIComponent(blob.data)}if(btoa){return data_URI_header+";base64,"+btoa(blob.data)}else{return data_URI_header+","+encodeURIComponent(blob.data)}}else if(real_create_object_URL){return real_create_object_URL.call(real_URL,blob)}};URL.revokeObjectURL=function(object_URL){if(object_URL.substring(0,5)!=="data:"&&real_revoke_object_URL){real_revoke_object_URL.call(real_URL,object_URL)}};FBB_proto.append=function(data){var bb=this.data;if(Uint8Array&&(data instanceof ArrayBuffer||data instanceof Uint8Array)){var str="",buf=new Uint8Array(data),i=0,buf_len=buf.length;for(;i<buf_len;i++){str+=String.fromCharCode(buf[i])}bb.push(str)}else if(get_class(data)==="Blob"||get_class(data)==="File"){if(FileReaderSync){var fr=new FileReaderSync;bb.push(fr.readAsBinaryString(data))}else{throw new FileException("NOT_READABLE_ERR")}}else if(data instanceof FakeBlob){if(data.encoding==="base64"&&atob){bb.push(atob(data.data))}else if(data.encoding==="URI"){bb.push(decodeURIComponent(data.data))}else if(data.encoding==="raw"){bb.push(data.data)}}else{if(typeof data!=="string"){data+=""}bb.push(unescape(encodeURIComponent(data)))}};FBB_proto.getBlob=function(type){if(!arguments.length){type=null}return new FakeBlob(this.data.join(""),type,"raw")};FBB_proto.toString=function(){return"[object BlobBuilder]"};FB_proto.slice=function(start,end,type){var args=arguments.length;if(args<3){type=null}return new FakeBlob(this.data.slice(start,args>1?end:this.data.length),type,this.encoding)};FB_proto.toString=function(){return"[object Blob]"};FB_proto.close=function(){this.size=0;delete this.data};return FakeBlobBuilder}(window);var Blob=function(blobParts,options){var type=options?options.type||"":"";var builder=new BlobBuilder;if(blobParts){for(var i=0,len=blobParts.length;i<len;i++){if(Uint8Array&&blobParts[i]instanceof Uint8Array){builder.append(blobParts[i].buffer)}else{builder.append(blobParts[i])}}}var blob=builder.getBlob(type);if(!blob.slice&&blob.webkitSlice){blob.slice=blob.webkitSlice}return blob};if(typeof define==="function"&&define.amd){define("blobjs",[],function(){return Blob})}if(typeof noGlobal==="undefined"){window.Blob=Blob}return Blob});
(function(e,t){if(typeof exports==="object"&&typeof exports.nodeName!=="string"){module.exports=e.document?t(e,true):function(e){if(!e.document){throw new Error("blobjs requires a window with a document")}return t(e)}}else{t(e)}})(window||this,function(e,t){"use strict";var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.URL=e.URL||e.webkitURL;if(e.Blob&&e.URL&&!n){try{new e.Blob;if(typeof define==="function"&&define.amd){define("blobjs",[],function(){return e.Blob})}return e.Blob}catch(e){}}var i=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},n=function e(){this.data=[]},i=function e(t,n,i){this.data=t;this.size=t.length;this.type=n;this.encoding=i},o=n.prototype,r=i.prototype,a=e.FileReaderSync,f=function(e){this.code=this[this.name=e]},c=("NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "+"NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR").split(" "),s=c.length,l=e.URL||e.webkitURL||e,u=l.createObjectURL,d=l.revokeObjectURL,p=l,b=e.btoa,h=e.atob,R=e.ArrayBuffer,g=e.Uint8Array,w=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;i.fake=r.fake=true;while(s--){f.prototype[c[s]]=s+1}if(!l.createObjectURL){p=e.URL=function(e){var t=document.createElementNS("http://www.w3.org/1999/xhtml","a"),n;t.href=e;if(!("origin"in t)){if(t.protocol.toLowerCase()==="data:"){t.origin=null}else{n=e.match(w);t.origin=n&&n[1]}}return t}}p.createObjectURL=function(e){var t=e.type,n;if(t===null){t="application/octet-stream"}if(e instanceof i){n="data:"+t;if(e.encoding==="base64"){return n+";base64,"+e.data}else if(e.encoding==="URI"){return n+","+decodeURIComponent(e.data)}if(b){return n+";base64,"+b(e.data)}else{return n+","+encodeURIComponent(e.data)}}else if(u){return u.call(l,e)}};p.revokeObjectURL=function(e){if(e.substring(0,5)!=="data:"&&d){d.call(l,e)}};o.append=function(e){var n=this.data;if(g&&(e instanceof R||e instanceof g)){var o="",r=new g(e),c=0,s=r.length;for(;c<s;c++){o+=String.fromCharCode(r[c])}n.push(o)}else if(t(e)==="Blob"||t(e)==="File"){if(a){var l=new a;n.push(l.readAsBinaryString(e))}else{throw new f("NOT_READABLE_ERR")}}else if(e instanceof i){if(e.encoding==="base64"&&h){n.push(h(e.data))}else if(e.encoding==="URI"){n.push(decodeURIComponent(e.data))}else if(e.encoding==="raw"){n.push(e.data)}}else{if(typeof e!=="string"){e+=""}n.push(unescape(encodeURIComponent(e)))}};o.getBlob=function(e){if(!arguments.length){e=null}return new i(this.data.join(""),e,"raw")};o.toString=function(){return"[object BlobBuilder]"};r.slice=function(e,t,n){var o=arguments.length;if(o<3){n=null}return new i(this.data.slice(e,o>1?t:this.data.length),n,this.encoding)};r.toString=function(){return"[object Blob]"};r.close=function(){this.size=0;delete this.data};return n}(e);var o=function(e,t){var n=t?t.type||"":"";var o=new i;if(e){for(var r=0,a=e.length;r<a;r++){if(Uint8Array&&e[r]instanceof Uint8Array){o.append(e[r].buffer)}else{o.append(e[r])}}}var f=o.getBlob(n);if(!f.slice&&f.webkitSlice){f.slice=f.webkitSlice}return f};var r=Object.getPrototypeOf||function(e){return e.__proto__};o.prototype=r(new e.Blob);if(typeof define==="function"&&define.amd){define("blobjs",[],function(){return o})}if(typeof t==="undefined"){e.Blob=o}return o});
{
"name": "blobjs",
"version": "1.1.0",
"version": "1.1.1",
"description": "native Blob interface support (polyfill)",

@@ -5,0 +5,0 @@ "main": "Blob.js",

{
"name": "blobjs",
"version": "1.1.0",
"version": "1.1.1",
"description": "native Blob interface support (polyfill)",
"main": "Blob.js",
"scripts": {
"test": "gulp"
"test": "exit 0",
"build": "node_modules/.bin/uglifyjs Blob.js --mangle --comments '/^!|@preserve|@license|@cc_on/i' > Blob.min.js"
},

@@ -28,3 +29,6 @@ "repository": {

},
"homepage": "https://github.com/clarketm/Blob.js#readme"
"homepage": "https://github.com/clarketm/Blob.js#readme",
"devDependencies": {
"uglify-js": "^2.7.4"
}
}

Sorry, the diff of this file is not supported yet

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