Socket
Socket
Sign inDemoInstall

@dxos/util

Package Overview
Dependencies
Maintainers
13
Versions
2987
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/util - npm Package Compare versions

Comparing version 2.5.2-alpha.0 to 2.5.2-beta.0

16

dist/src/timeout-warning.d.ts

@@ -9,3 +9,19 @@ /**

export declare function warnAfterTimeout<T>(timeout: number, context: string, body: () => Promise<T>): Promise<T>;
/**
* A decorator that prints a warning to console if method execution time exceeds specified timeout.
*
* ```typescript
* class Foo {
* @timed(5000)
* async doStuff() {
* // long task
* }
* }
* ```
*
* This is useful for debugging code that might deadlock.
*
* @param timeout Timeout in milliseconds after which the warning is printed.
*/
export declare function timed(timeout: number): (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => void;
//# sourceMappingURL=timeout-warning.d.ts.map

@@ -27,2 +27,18 @@ "use strict";

exports.warnAfterTimeout = warnAfterTimeout;
/**
* A decorator that prints a warning to console if method execution time exceeds specified timeout.
*
* ```typescript
* class Foo {
* @timed(5000)
* async doStuff() {
* // long task
* }
* }
* ```
*
* This is useful for debugging code that might deadlock.
*
* @param timeout Timeout in milliseconds after which the warning is printed.
*/
function timed(timeout) {

@@ -29,0 +45,0 @@ return (target, propertyName, descriptor) => {

6

package.json
{
"name": "@dxos/util",
"version": "2.5.2-alpha.0",
"version": "2.5.2-beta.0",
"description": "Utilities to be moved to other repos.",

@@ -20,3 +20,3 @@ "homepage": "https://github.com/dxos/echo/tree/master/packages/echo#readme",

"depcheck": "npx depcheck --specials=bin,babel,eslint,lint-staged,jest",
"coverage": "jest --coverage --verbose src",
"coverage": "jest --coverage --verbose --rootDir=./src",
"lint": "eslint './src/**/*.ts'",

@@ -67,3 +67,3 @@ "test": "jest --rootDir=./src --verbose --passWithNoTests",

},
"gitHead": "0b12ed4c090d34a5454e0d637503b20ad486d592"
"gitHead": "e9498f19374c7dce5570abb4a55780477b93bc9c"
}

@@ -24,2 +24,18 @@ //

/**
* A decorator that prints a warning to console if method execution time exceeds specified timeout.
*
* ```typescript
* class Foo {
* @timed(5000)
* async doStuff() {
* // long task
* }
* }
* ```
*
* This is useful for debugging code that might deadlock.
*
* @param timeout Timeout in milliseconds after which the warning is printed.
*/
export function timed (timeout: number) {

@@ -26,0 +42,0 @@ return (

Sorry, the diff of this file is not supported yet

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