@php-wasm/node-polyfills 0.6.1 → 0.6.3

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.
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 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});
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}
package/index.js CHANGED
@@ -57,6 +57,3 @@ 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
- });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/node-polyfills",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
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": "171b22b853786b8912d9624ea064eaa1e985e96b"
33
+ "gitHead": "0a8916ec08aa5f02de5fea308b287171e7948e4b"
34
34
  }
@@ -1,4 +0,0 @@
1
- const e = {};
2
- export {
3
- e as default
4
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={};exports.default=e;
package/lib/crypto.d.ts DELETED
File without changes