Socket
Socket
Sign inDemoInstall

metautil

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metautil - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

9

CHANGELOG.md

@@ -5,2 +5,8 @@ # Changelog

## [3.5.0][] - 2021-02-22
- Implemented `await delay(msec, signal)`
- Fix timeout behaviour to reject promise (throw)
- Generate errors on timeout and on abort timeout
## [3.4.0][] - 2021-02-21

@@ -43,3 +49,4 @@

[unreleased]: https://github.com/metarhia/metautil/compare/v3.4.0...HEAD
[unreleased]: https://github.com/metarhia/metautil/compare/v3.5.0...HEAD
[3.5.0]: https://github.com/metarhia/metautil/compare/v3.4.0...v3.5.0
[3.4.0]: https://github.com/metarhia/metautil/compare/v3.3.0...v3.4.0

@@ -46,0 +53,0 @@ [3.3.0]: https://github.com/metarhia/metautil/compare/v3.2.0...v3.3.0

@@ -155,2 +155,14 @@ 'use strict';

new Promise((resolve, reject) => {
const timer = setTimeout(() => {
reject(new Error('Timeout reached'));
}, msec);
if (!signal) return;
signal.on('abort', () => {
clearTimeout(timer);
reject(new Error('Timeout aborted'));
});
});
const delay = (msec, signal = null) =>
new Promise((resolve, reject) => {
const timer = setTimeout(resolve, msec);

@@ -160,3 +172,3 @@ if (!signal) return;

clearTimeout(timer);
reject();
reject(new Error('Delay aborted'));
});

@@ -182,2 +194,3 @@ });

timeout,
delay,
};

2

package.json
{
"name": "metautil",
"version": "3.4.0",
"version": "3.5.0",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",

@@ -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