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

@therms/web-js

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@therms/web-js - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [1.6.0](http://bitbucket.org/thermsio/web-js/compare/v1.5.0...v1.6.0) (2022-01-16)
### Features
* **PromiseController:** allow no timeout in ctor ([d0c7a39](http://bitbucket.org/thermsio/web-js/commits/d0c7a39bb48b1b73bdf33f14efb98ef734490afb))
# [1.5.0](http://bitbucket.org/thermsio/web-js/compare/v1.4.0...v1.5.0) (2022-01-16)

@@ -2,0 +9,0 @@

15

dist/cjs.js

@@ -439,7 +439,14 @@ 'use strict';

promise;
constructor(timeout) {
/**
* The default promise timeout is 30sec, if there is no need for a timeout fail-safe, pass "false"
* @param timeout
*/
constructor(timeout = DEFAULT_TIMEOUT) {
this.promise = new Promise((resolve, reject) => {
const timer = setTimeout(() => {
reject(new PromiseTimeoutError('PromiseWraper timeout'));
}, timeout || DEFAULT_TIMEOUT);
let timer;
if (timeout > 0) {
timer = setTimeout(() => {
reject(new PromiseTimeoutError('PromiseWraper timeout'));
}, timeout);
}
this.rejectPromise = (arg) => {

@@ -446,0 +453,0 @@ clearTimeout(timer);

@@ -10,5 +10,9 @@ export declare class PromiseTimeoutError extends Error {

readonly promise: Promise<T>;
constructor(timeout?: number);
/**
* The default promise timeout is 30sec, if there is no need for a timeout fail-safe, pass "false"
* @param timeout
*/
constructor(timeout?: boolean | number);
reject: (rejectReturnValue?: E) => any;
resolve: (resolveReturnValue: T) => void;
}

@@ -11,7 +11,14 @@ const DEFAULT_TIMEOUT = 30000;

promise;
constructor(timeout) {
/**
* The default promise timeout is 30sec, if there is no need for a timeout fail-safe, pass "false"
* @param timeout
*/
constructor(timeout = DEFAULT_TIMEOUT) {
this.promise = new Promise((resolve, reject) => {
const timer = setTimeout(() => {
reject(new PromiseTimeoutError('PromiseWraper timeout'));
}, timeout || DEFAULT_TIMEOUT);
let timer;
if (timeout > 0) {
timer = setTimeout(() => {
reject(new PromiseTimeoutError('PromiseWraper timeout'));
}, timeout);
}
this.rejectPromise = (arg) => {

@@ -18,0 +25,0 @@ clearTimeout(timer);

{
"name": "@therms/web-js",
"version": "1.5.0",
"version": "1.6.0",
"description": "Common web/JS tools & utilities",

@@ -5,0 +5,0 @@ "main": "dist/cjs.js",

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