@gjsify/vm 0.3.21 → 0.4.0

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 @@
1
+ var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0});export{__name};
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- const contextSymbol=Symbol(`vm.context`);function runInThisContext(code,_options){return eval(code)}function runInNewContext(e,t,n){let r=t||{},i=Object.keys(r),a=i.map(e=>r[e]);return Function(...i,`return eval(${JSON.stringify(e)})`)(...a)}function runInContext(e,t,n){return runInNewContext(e,t)}function createContext(e){let t=e||{};return Object.defineProperty(t,contextSymbol,{value:!0,enumerable:!1}),t}function isContext(e){if(typeof e!=`object`||!e)throw TypeError(`The "object" argument must be of type object. Received ${e===null?`null`:`type ${typeof e}`}`);return e[contextSymbol]===!0}function compileFunction(e,t,n){return Function(...t||[],e)}var Script=class{_code;constructor(e,t){this._code=e}runInThisContext(_options){return eval(this._code)}runInNewContext(e,t){return runInNewContext(this._code,e)}runInContext(e,t){return runInNewContext(this._code,e)}createCachedData(){return new Uint8Array}},src_default={runInThisContext,runInNewContext,runInContext,createContext,isContext,compileFunction,Script};export{Script,compileFunction,createContext,src_default as default,isContext,runInContext,runInNewContext,runInThisContext};
1
+ import{__name}from"./_virtual/_rolldown/runtime.js";const contextSymbol=Symbol(`vm.context`);function runInThisContext(code,_options){return eval(code)}function runInNewContext(e,t,n){let r=t||{},i=Object.keys(r),a=i.map(e=>r[e]);return Function(...i,`return eval(${JSON.stringify(e)})`)(...a)}function runInContext(e,t,n){return runInNewContext(e,t)}function createContext(e){let t=e||{};return Object.defineProperty(t,contextSymbol,{value:!0,enumerable:!1}),t}function isContext(e){if(typeof e!=`object`||!e)throw TypeError(`The "object" argument must be of type object. Received ${e===null?`null`:`type ${typeof e}`}`);return e[contextSymbol]===!0}function compileFunction(e,t,n){return Function(...t||[],e)}var Script=class{_code;constructor(e,t){this._code=e}runInThisContext(_options){return eval(this._code)}runInNewContext(e,t){return runInNewContext(this._code,e)}runInContext(e,t){return runInNewContext(this._code,e)}createCachedData(){return new Uint8Array}},src_default={runInThisContext,runInNewContext,runInContext,createContext,isContext,compileFunction,Script};export{Script,compileFunction,createContext,src_default as default,isContext,runInContext,runInNewContext,runInThisContext};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/vm",
3
- "version": "0.3.21",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js vm module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -30,8 +30,8 @@
30
30
  "vm"
31
31
  ],
32
32
  "devDependencies": {
33
- "@gjsify/cli": "^0.3.21",
34
- "@gjsify/unit": "^0.3.21",
33
+ "@gjsify/cli": "^0.4.0",
34
+ "@gjsify/unit": "^0.4.0",
35
35
  "@types/node": "^25.6.2",
36
36
  "typescript": "^6.0.3"
37
37
  }