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

function-timeout

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-timeout - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

browser.js

@@ -12,1 +12,5 @@ // Even though the browser version is a no-op, we wrap it to ensure consistent behavior.

}
export function isTimeoutError() {
return false;
}

5

index.js
import vm from 'node:vm';
export default function functionTimeout(function_, {timeout} = {}) {
const script = new vm.Script('returnValue = function_(...arguments_)');
const script = new vm.Script('returnValue = function_()');
const wrappedFunction = (...arguments_) => {
const context = {
function_,
arguments_,
function_: () => function_(...arguments_),
};

@@ -11,0 +10,0 @@

{
"name": "function-timeout",
"version": "0.1.0",
"version": "0.1.1",
"description": "Make a synchronous function have a timeout",

@@ -5,0 +5,0 @@ "license": "MIT",

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