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

@mitm/common

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mitm/common - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

9

common.esm.js

@@ -56,2 +56,9 @@ import { shareReplay } from 'rxjs/operators';

function wait(milliseconds = 0) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}
function waitThenReject(milliseconds = 0, error = new Error(`${waitThenReject.name} ${milliseconds}ms`)) {
return new Promise((resolve, reject) => setTimeout(() => reject(error), milliseconds));
}
/**

@@ -165,2 +172,2 @@ * A RolesHierarchy holds a hierarchy of roles (surprised?) and provides utilities to query this hierarchy.

export { RolesHierarchy, arrayPairwise, ensureNotNull, ethrow, evalThunk, filterOutNullArrayEntries, getStacktrace, normalizeToArray, shareReplayOne, throwThisShouldNeverHappenError, throwUnexpectedTypeError };
export { RolesHierarchy, arrayPairwise, ensureNotNull, ethrow, evalThunk, filterOutNullArrayEntries, getStacktrace, normalizeToArray, shareReplayOne, throwThisShouldNeverHappenError, throwUnexpectedTypeError, wait, waitThenReject };

@@ -64,2 +64,27 @@ (function (global, factory) {

function wait(milliseconds) {
if (milliseconds === void 0) {
milliseconds = 0;
}
return new Promise(function (resolve) {
return setTimeout(resolve, milliseconds);
});
}
function waitThenReject(milliseconds, error) {
if (milliseconds === void 0) {
milliseconds = 0;
}
if (error === void 0) {
error = new Error(waitThenReject.name + " " + milliseconds + "ms");
}
return new Promise(function (resolve, reject) {
return setTimeout(function () {
return reject(error);
}, milliseconds);
});
}
/**

@@ -195,2 +220,4 @@ * A RolesHierarchy holds a hierarchy of roles (surprised?) and provides utilities to query this hierarchy.

exports.throwUnexpectedTypeError = throwUnexpectedTypeError;
exports.wait = wait;
exports.waitThenReject = waitThenReject;

@@ -197,0 +224,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

2

package.json
{
"name": "@mitm/common",
"version": "1.2.2",
"version": "1.3.0",
"main": "./common.umd.js",

@@ -5,0 +5,0 @@ "module": "./common.esm.js",

export declare type MaybePromise<T> = T | Promise<T>;
export declare function wait(milliseconds?: number): Promise<void>;
export declare function waitThenReject(milliseconds?: number, error?: Error): Promise<void>;
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