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

@wixc3/engine-core-node

Package Overview
Dependencies
Maintainers
173
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wixc3/engine-core-node - npm Package Compare versions

Comparing version 22.1.2 to 22.1.3

1

dist/ipc-host.d.ts
/// <reference types="node" />
import { BaseHost, IDisposable, Message } from '@wixc3/engine-core';
import type { ChildProcess } from 'child_process';
export declare const isParentProcess: (process: NodeJS.Process | ChildProcess) => process is NodeJS.Process;
export declare class IPCHost extends BaseHost implements IDisposable {

@@ -5,0 +6,0 @@ private process;

27

dist/ipc-host.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IPCHost = void 0;
exports.IPCHost = exports.isParentProcess = void 0;
const engine_core_1 = require("@wixc3/engine-core");
const isParentProcess = (process) => {
return !!process.ppid;
};
exports.isParentProcess = isParentProcess;
class IPCHost extends engine_core_1.BaseHost {

@@ -32,12 +36,17 @@ constructor(process) {

}
if (this.process.killed) {
this.emitMessageHandlers({
from: data.to,
type: 'dispose',
to: '*',
origin: data.to,
});
const disposeHandlers = (e) => {
if (e) {
this.emitMessageHandlers({
from: data.to,
type: 'dispose',
to: '*',
origin: data.to,
});
}
};
if ((0, exports.isParentProcess)(this.process)) {
this.process.send(data, undefined, undefined, disposeHandlers);
}
else {
this.process.send(data);
this.process.send(data, disposeHandlers);
}

@@ -44,0 +53,0 @@ }

{
"name": "@wixc3/engine-core-node",
"version": "22.1.2",
"version": "22.1.3",
"main": "dist/index.js",

@@ -13,3 +13,3 @@ "types": "dist/index.d.ts",

"create-listening-server": "^1.0.0",
"express": "^4.17.1",
"express": "^4.17.2",
"socket.io": "^4.4.0"

@@ -16,0 +16,0 @@ },

import { BaseHost, IDisposable, Message } from '@wixc3/engine-core';
import type { ChildProcess } from 'child_process';
export const isParentProcess = (process: NodeJS.Process | ChildProcess): process is NodeJS.Process => {
return !!(process as NodeJS.Process).ppid;
};
export class IPCHost extends BaseHost implements IDisposable {

@@ -33,11 +37,17 @@ private disposed = false;

}
if ((this.process as ChildProcess).killed) {
this.emitMessageHandlers({
from: data.to,
type: 'dispose',
to: '*',
origin: data.to,
});
const disposeHandlers = (e: Error | null) => {
if (e) {
this.emitMessageHandlers({
from: data.to,
type: 'dispose',
to: '*',
origin: data.to,
});
}
};
if (isParentProcess(this.process)) {
this.process.send(data, undefined, undefined, disposeHandlers);
} else {
this.process.send(data);
this.process.send(data, disposeHandlers);
}

@@ -44,0 +54,0 @@ }

Sorry, the diff of this file is not supported yet

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