Socket
Socket
Sign inDemoInstall

worktank

Package Overview
Dependencies
2
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.1 to 2.5.2

2

dist/index.js

@@ -91,2 +91,4 @@ /* IMPORT */

throw new Error('Unsupported method name');
if (method === 'then')
return; //UGLY: Hacky limitation, because a wrapping Promise will lookup this property
return (...args) => {

@@ -93,0 +95,0 @@ return this.exec(method, args);

2

dist/types.d.ts

@@ -31,3 +31,3 @@ type FN = (...args: any[]) => any;

type MethodsProxied<T extends Methods> = {
[K in keyof T]: (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>>;
[K in Exclude<keyof T, 'then'>]: (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>>;
};

@@ -34,0 +34,0 @@ type MethodFunction<T extends Methods, U extends MethodsNames<T>> = T[U];

@@ -5,3 +5,3 @@ {

"description": "A simple isomorphic library for executing functions inside WebWorkers or Node Threads pools.",
"version": "2.5.1",
"version": "2.5.2",
"type": "module",

@@ -8,0 +8,0 @@ "main": "dist/index.js",

@@ -158,6 +158,8 @@

get: <U extends MethodsNames<T>> ( _: unknown, method: U | symbol | number ): MethodProxied<MethodFunction<T, U>> => {
get: <U extends MethodsNames<T>> ( _: unknown, method: U | symbol | number ): MethodProxied<MethodFunction<T, U>> | undefined => {
if ( typeof method !== 'string' ) throw new Error ( 'Unsupported method name' );
if ( method === 'then' ) return; //UGLY: Hacky limitation, because a wrapping Promise will lookup this property
return ( ...args: MethodArguments<T, U> ): Promise<Awaited<MethodReturn<T, U>>> => {

@@ -164,0 +166,0 @@

@@ -48,3 +48,3 @@

type MethodsProxied<T extends Methods> = { [K in keyof T]: (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>> };
type MethodsProxied<T extends Methods> = { [K in Exclude<keyof T, 'then'>]: (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>> };

@@ -51,0 +51,0 @@ type MethodFunction<T extends Methods, U extends MethodsNames<T>> = T[U];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc