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

accordant

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accordant - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

src/transferable.js

3

package.json
{
"name": "accordant",
"version": "0.1.0",
"version": "0.1.1",
"keywords": [

@@ -14,2 +14,3 @@ "Worker",

"./shared-worker": "./src/shared.js",
"./transferable": "./src/transferable.js",
"./worker": "./src/worker.js",

@@ -16,0 +17,0 @@ "./package.json": "./package.json"

import { isArray, stop } from './utils.js';
import Transferable from './transferable.js';

@@ -17,6 +18,13 @@ class EventHandler {

const response = [channel, id];
const send = [response];
const proxy = await this.#promise;
if (name in proxy) {
try {
response.push(await proxy[name](...args));
const result = await proxy[name](...args);
if (result instanceof Transferable) {
response.push(result.data);
send.push(result.options);
}
else
response.push(result);
}

@@ -30,3 +38,3 @@ catch (error) {

}
currentTarget.postMessage(response);
currentTarget.postMessage(...send);
}

@@ -33,0 +41,0 @@ }

@@ -1,2 +0,2 @@

import { withResolvers } from './utils.js';
import { assign, withResolvers } from './utils.js';
import accordant from './accordant.js';

@@ -6,2 +6,4 @@

const ffi = {};
addEventListener('connect', async ({ ports }) => {

@@ -14,2 +16,2 @@ for (const port of ports) {

export default resolve;
export default bindings => resolve(assign(ffi, bindings));
const { isArray } = Array;
export { isArray };
const { assign } = Object;
export { assign, isArray };

@@ -4,0 +5,0 @@ export const stop = event => {

@@ -1,2 +0,2 @@

import { withResolvers } from './utils.js';
import { assign, withResolvers } from './utils.js';
import accordant from './accordant.js';

@@ -6,4 +6,6 @@

const ffi = {};
accordant(self, promise);
export default resolve;
export default bindings => resolve(assign(ffi, bindings));
import exports from '../src/worker.js';
exports({
multiple: 'bindings',
});
exports({
random: () => ({ Worker: Math.random() }),
});
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