@php-wasm/node-polyfills 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ const e = {};
2
+ export {
3
+ e as default
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={};exports.default=e;
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";if(typeof File>"u"){class e extends Blob{constructor(r,n,i){super(r);let o;i!=null&&i.lastModified&&(o=new Date),(!o||isNaN(o.getFullYear()))&&(o=new Date),this.lastModifiedDate=o,this.lastModified=o.getMilliseconds(),this.name=n||""}}global.File=e}function u(e){return new Promise(function(t,r){e.onload=e.onerror=function(n){e.onload=e.onerror=null,n.type==="load"?t(e.result):r(new Error("Failed to read the blob/file"))}})}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const t=new FileReader;return t.readAsArrayBuffer(this),u(t)});typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const t=new FileReader;return t.readAsText(this),u(t)});function f(){const e=new Uint8Array([1,2,3,4]),r=new File([e],"test").stream();try{return r.getReader({mode:"byob"}),!0}catch{return!1}}(typeof Blob.prototype.stream>"u"||!f())&&(Blob.prototype.stream=function(){let e=0;const t=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(r){const n=r.byobRequest.view,o=await t.slice(e,e+n.byteLength).arrayBuffer(),s=new Uint8Array(o);new Uint8Array(n.buffer).set(s);const a=s.byteLength;r.byobRequest.respond(a),e+=a,e>=t.size&&r.close()}})});if(typeof CustomEvent>"u"){class e extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=e}
1
+ "use strict";if(typeof File>"u"){class e extends Blob{constructor(r,n,i){super(r);let o;i!=null&&i.lastModified&&(o=new Date),(!o||isNaN(o.getFullYear()))&&(o=new Date),this.lastModifiedDate=o,this.lastModified=o.getMilliseconds(),this.name=n||""}}global.File=e}function f(e){return new Promise(function(t,r){e.onload=e.onerror=function(n){e.onload=e.onerror=null,n.type==="load"?t(e.result):r(new Error("Failed to read the blob/file"))}})}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const t=new FileReader;return t.readAsArrayBuffer(this),f(t)});typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const t=new FileReader;return t.readAsText(this),f(t)});function l(){const e=new Uint8Array([1,2,3,4]),r=new File([e],"test").stream();try{return r.getReader({mode:"byob"}),!0}catch{return!1}}(typeof Blob.prototype.stream>"u"||!l())&&(Blob.prototype.stream=function(){let e=0;const t=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(r){const n=r.byobRequest.view,o=await t.slice(e,e+n.byteLength).arrayBuffer(),s=new Uint8Array(o);new Uint8Array(n.buffer).set(s);const a=s.byteLength;r.byobRequest.respond(a),e+=a,e>=t.size&&r.close()}})});if(typeof CustomEvent>"u"){class e extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=e}typeof crypto>"u"&&Promise.resolve().then(()=>require("./__vite-browser-external-b3701507.cjs")).then(e=>{global.crypto=e});
package/index.js CHANGED
@@ -57,3 +57,6 @@ if (typeof CustomEvent > "u") {
57
57
  }
58
58
  globalThis.CustomEvent = e;
59
59
  }
60
+ typeof crypto > "u" && import("./__vite-browser-external-2447137e.js").then((e) => {
61
+ global.crypto = e;
62
+ });
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node-polyfills",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "PHP.wasm – polyfills for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,5 +30,5 @@
30
30
  "directory": "../../../dist/packages/php-wasm/node-polyfills"
31
31
  },
32
32
  "license": "GPL-2.0-or-later",
33
- "gitHead": "3f137306ec8e3b10ec0674a1fe69ee43349edb4a"
33
+ "gitHead": "171b22b853786b8912d9624ea064eaa1e985e96b"
34
34
  }