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

callback-timeout

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callback-timeout - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.zuul.yml

7

errors.js

@@ -1,9 +0,10 @@

var inherits = require('util').inherits
var inherits = require('util').inherits,
captureStackTrace = require('capture-stack-trace')
module.exports.TimeoutError = TimeoutError
function TimeoutError (message) {
Error.captureStackTrace(this, TimeoutError)
this.name = 'TimeoutError'
captureStackTrace(this, TimeoutError)
this.name = this.constructor.name
this.message = message
}
inherits(TimeoutError, Error)
{
"name": "callback-timeout",
"version": "1.0.0",
"version": "1.0.1",
"description": "Invokes callback with single error argument if timeout occurs before it's invoked by other means",

@@ -37,3 +37,5 @@ "main": "index.js",

"license": "MIT",
"dependencies": {}
"dependencies": {
"capture-stack-trace": "~1.0.0"
}
}
var test = require('tape'),
timeout = require('..')
test(function (t) {
test('with error message provided', function (t) {
t.plan(3)

@@ -6,0 +6,0 @@

var test = require('tape'),
timeout = require('..')
test(function (t) {
test('with no timeout given', function (t) {
t.plan(3)

@@ -6,0 +6,0 @@

@@ -5,4 +5,4 @@ var test = require('tape'),

test(function (t) {
t.plan(4)
test('with timeouts given', function (t) {
t.plan(5)

@@ -29,4 +29,5 @@ function doSomethingFast (cb) { setTimeout(cb, 100) }

t.ok(err instanceof TimeoutError, 'error is a TimeoutError')
t.equals(err.name, 'TimeoutError', 'error.name is TimeoutError')
}, 250))
})
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