New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@defer.run/client

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@defer.run/client - npm Package Compare versions

Comparing version 0.1.0-alpha-20221212161413-b16bafa to 0.1.0-alpha-20221213104542-982bcde

24

cjs/index.js

@@ -36,2 +36,3 @@ "use strict";

};
ret.__fn = fn;
return ret;

@@ -43,20 +44,11 @@ };

const executionResult = await (0, exports.defer)(fn)(...args);
if (executionResult.runId) {
return await (0, execute_js_1.poolForExecutionResult)(fn.name, executionResult.runId,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
fetcher, debug);
}
else {
throw new Error(executionResult.error || "Failed to create execution");
}
// an exception is raised in case of failed execution creation, the below code becoming unreachable
return await (0, execute_js_1.poolForExecutionResult)(fn.name,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
executionResult.id,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
fetcher, debug);
};
ret.__fn = fn;
return ret;
};
// TS tests
// (async function() {
// const a = (input: string) => Promise.resolve(1);
// const b = await defer(a)("");
// // ^?
// const c = await defer.await(a);
// // ^?
// });

@@ -32,2 +32,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

};
ret.__fn = fn;
return ret;

@@ -38,20 +39,11 @@ };

const executionResult = await defer(fn)(...args);
if (executionResult.runId) {
return await poolForExecutionResult(fn.name, executionResult.runId,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
fetcher, debug);
}
else {
throw new Error(executionResult.error || "Failed to create execution");
}
// an exception is raised in case of failed execution creation, the below code becoming unreachable
return await poolForExecutionResult(fn.name,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
executionResult.id,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
fetcher, debug);
};
ret.__fn = fn;
return ret;
};
// TS tests
// (async function() {
// const a = (input: string) => Promise.resolve(1);
// const b = await defer(a)("");
// // ^?
// const c = await defer.await(a);
// // ^?
// });
{
"name": "@defer.run/client",
"version": "0.1.0-alpha-20221212161413-b16bafa",
"version": "0.1.0-alpha-20221213104542-982bcde",
"description": "cua JavaScript client",

@@ -5,0 +5,0 @@ "dependencies": {

import type { DeferConfiguredFetcher } from "./fetcher.js";
export interface DeferExecuteResponse {
runId?: string;
id?: string;
error?: string;

@@ -5,0 +5,0 @@ }

@@ -9,7 +9,15 @@ import { DeferExecuteResponse } from "./execute.js";

declare type UnPromise<F> = F extends Promise<infer R> ? R : F;
interface DeferRetFn<F extends (...args: any | undefined) => Promise<any>> {
(...args: Parameters<F>): Promise<DeferExecuteResponse>;
__fn: F;
}
interface DeferAwaitRetFn<F extends (...args: any | undefined) => Promise<any>> {
(...args: Parameters<F>): Promise<UnPromise<ReturnType<F>>>;
__fn: F;
}
interface Defer {
<F extends (...args: any | undefined) => Promise<any>>(fn: F): (...args: Parameters<F>) => Promise<DeferExecuteResponse>;
await: <F extends (...args: any | undefined) => Promise<any>>(fn: F) => (...args: Parameters<F>) => Promise<DeferExecuteResponse | UnPromise<ReturnType<F>>>;
<F extends (...args: any | undefined) => Promise<any>>(fn: F): DeferRetFn<F>;
await: <F extends (...args: any | undefined) => Promise<any>>(fn: F) => DeferAwaitRetFn<F>;
}
export declare const defer: Defer;
export {};

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