@gjsify/node-globals 0.4.21 → 0.4.23

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.
@@ -1 +1 @@
1
- import{Buffer as e}from"@gjsify/buffer";import"@gjsify/buffer/register";`Buffer`in globalThis||Object.defineProperty(globalThis,`Buffer`,{value:e,enumerable:!1,writable:!0,configurable:!0});
1
+ import{Buffer as e}from"@gjsify/buffer";import"@gjsify/buffer/register";`Buffer`in globalThis||Object.defineProperty(globalThis,"Buffer",{value:e,enumerable:!1,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import e from"@girs/glib-2.0";typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,`btoa`,{value:function btoa(t){let n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e)&255;return e.base64_encode(n)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,`atob`,{value:function atob(t){let n=e.base64_decode(t),r=``;for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return r},enumerable:!0,writable:!0,configurable:!0});
1
+ import e from"@girs/glib-2.0";typeof globalThis.btoa!=`function`&&Object.defineProperty(globalThis,"btoa",{value:function btoa(t){let n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e)&255;return e.base64_encode(n)},enumerable:!0,writable:!0,configurable:!0}),typeof globalThis.atob!=`function`&&Object.defineProperty(globalThis,"atob",{value:function atob(t){let n=e.base64_decode(t),r=``;for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return r},enumerable:!0,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import{queueMicrotask as e}from"@gjsify/utils";typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,`queueMicrotask`,{value:e,enumerable:!0,writable:!0,configurable:!0});
1
+ import{queueMicrotask as e}from"@gjsify/utils";typeof queueMicrotask!=`function`&&Object.defineProperty(globalThis,"queueMicrotask",{value:e,enumerable:!0,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import{initErrorV8Methods as e}from"@gjsify/utils";import t from"@gjsify/process";typeof Promise.withResolvers!=`function`&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}),e(Error),`global`in globalThis||Object.defineProperty(globalThis,`global`,{value:globalThis,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(globalThis,`process`,{value:t,enumerable:!1,writable:!0,configurable:!0});
1
+ import{initErrorV8Methods as e}from"@gjsify/utils";import t from"@gjsify/process";typeof Promise.withResolvers!=`function`&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}),e(Error),`global`in globalThis||Object.defineProperty(globalThis,"global",{value:globalThis,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(globalThis,"process",{value:t,enumerable:!1,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import{structuredClone as e}from"@gjsify/utils";typeof globalThis.structuredClone!=`function`&&Object.defineProperty(globalThis,`structuredClone`,{value:e,enumerable:!0,writable:!0,configurable:!0});
1
+ import{structuredClone as e}from"@gjsify/utils";typeof globalThis.structuredClone!=`function`&&Object.defineProperty(globalThis,"structuredClone",{value:e,enumerable:!0,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";function getGLib(){return globalThis.imports?.gi?.GLib}const e=getGLib()!==void 0;var GjsifyTimeout=class{_id=null;_refed=!0;_callback;_delay;_args;_repeat;constructor(e,t,n,r){this._callback=e,this._delay=t,this._args=n,this._repeat=r,this._schedule()}_schedule(){let e=getGLib();if(!e)return;let t=e.timeout_add.bind(e);this._id=t(e.PRIORITY_DEFAULT,this._delay,()=>{try{this._callback.apply(globalThis,this._args)}catch(e){setTimeout(()=>{throw e},0)}return this._repeat?e.SOURCE_CONTINUE:(this._id=null,e.SOURCE_REMOVE)})}ref(){return this._refed=!0,this}unref(){return this._refed=!1,this}hasRef(){return this._refed}refresh(){return this._cancel(),this._schedule(),this}_cancel(){if(this._id!==null){try{getGLib()?.Source.remove(this._id)}catch{}this._id=null}}[Symbol.toPrimitive](){return this._id}[Symbol.dispose](){this._cancel()}};function removeById(e){if(e instanceof GjsifyTimeout)e._cancel();else if(typeof e==`number`)try{getGLib()?.Source.remove(e)}catch{}}if(e){let setT=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!1),setI=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!0),e=globalThis;e.setTimeout=setT,e.clearTimeout=removeById,e.setInterval=setI,e.clearInterval=removeById}function setImmediate(e,...t){return setTimeout(e,0,...t)}function clearImmediate(e){clearTimeout(e)}`setImmediate`in globalThis||Object.defineProperty(globalThis,`setImmediate`,{value:setImmediate,enumerable:!0,writable:!0,configurable:!0}),`clearImmediate`in globalThis||Object.defineProperty(globalThis,`clearImmediate`,{value:clearImmediate,enumerable:!0,writable:!0,configurable:!0});
1
+ import"../_virtual/_rolldown/runtime.js";function getGLib(){return globalThis.imports?.gi?.GLib}const e=getGLib()!==void 0;var GjsifyTimeout=class{_id=null;_refed=!0;_callback;_delay;_args;_repeat;constructor(e,t,n,r){this._callback=e,this._delay=t,this._args=n,this._repeat=r,this._schedule()}_schedule(){let e=getGLib();if(!e)return;let t=e.timeout_add.bind(e);this._id=t(e.PRIORITY_DEFAULT,this._delay,()=>{try{this._callback.apply(globalThis,this._args)}catch(e){setTimeout(()=>{throw e},0)}return this._repeat?e.SOURCE_CONTINUE:(this._id=null,e.SOURCE_REMOVE)})}ref(){return this._refed=!0,this}unref(){return this._refed=!1,this}hasRef(){return this._refed}refresh(){return this._cancel(),this._schedule(),this}_cancel(){if(this._id!==null){try{getGLib()?.Source.remove(this._id)}catch{}this._id=null}}[Symbol.toPrimitive](){return this._id}[Symbol.dispose](){this._cancel()}};function removeById(e){if(e instanceof GjsifyTimeout)e._cancel();else if(typeof e==`number`)try{getGLib()?.Source.remove(e)}catch{}}if(e){let setT=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!1),setI=(e,t=0,...n)=>new GjsifyTimeout(e,Math.max(0,t|0),n,!0),e=globalThis;e.setTimeout=setT,e.clearTimeout=removeById,e.setInterval=setI,e.clearInterval=removeById}function setImmediate(e,...t){return setTimeout(e,0,...t)}function clearImmediate(e){clearTimeout(e)}`setImmediate`in globalThis||Object.defineProperty(globalThis,"setImmediate",{value:setImmediate,enumerable:!0,writable:!0,configurable:!0}),`clearImmediate`in globalThis||Object.defineProperty(globalThis,"clearImmediate",{value:clearImmediate,enumerable:!0,writable:!0,configurable:!0});
@@ -1 +1 @@
1
- import{URL as e,URLSearchParams as t}from"@gjsify/url";typeof globalThis.URL!=`function`&&Object.defineProperty(globalThis,`URL`,{value:e,enumerable:!1,writable:!0,configurable:!0}),typeof globalThis.URLSearchParams!=`function`&&Object.defineProperty(globalThis,`URLSearchParams`,{value:t,enumerable:!1,writable:!0,configurable:!0});
1
+ import{URL as e,URLSearchParams as t}from"@gjsify/url";typeof globalThis.URL!=`function`&&Object.defineProperty(globalThis,"URL",{value:e,enumerable:!1,writable:!0,configurable:!0}),typeof globalThis.URLSearchParams!=`function`&&Object.defineProperty(globalThis,"URLSearchParams",{value:t,enumerable:!1,writable:!0,configurable:!0});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/node-globals",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "description": "Node.js globals module for Gjs",
5
5
  "keywords": [
6
6
  "gjs",
@@ -63,16 +63,16 @@
63
63
  "test:node": "node test.node.mjs"
64
64
  },
65
65
  "dependencies": {
66
- "@girs/glib-2.0": "2.88.0-4.0.0-rc.15",
67
- "@gjsify/buffer": "^0.4.21",
68
- "@gjsify/process": "^0.4.21",
69
- "@gjsify/url": "^0.4.21",
70
- "@gjsify/utils": "^0.4.21"
66
+ "@girs/glib-2.0": "2.88.0-4.0.1",
67
+ "@gjsify/buffer": "^0.4.23",
68
+ "@gjsify/process": "^0.4.23",
69
+ "@gjsify/url": "^0.4.23",
70
+ "@gjsify/utils": "^0.4.23"
71
71
  },
72
72
  "devDependencies": {
73
- "@gjsify/cli": "^0.4.21",
74
- "@gjsify/unit": "^0.4.21",
75
- "@types/node": "^25.6.2",
73
+ "@gjsify/cli": "^0.4.23",
74
+ "@gjsify/unit": "^0.4.23",
75
+ "@types/node": "^25.9.1",
76
76
  "typescript": "^6.0.3"
77
77
  }
78
78
  }