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

@matrixai/contexts

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrixai/contexts - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

7

dist/utils.d.ts
import type { ResourceAcquire } from '@matrixai/resources';
import type { PromiseCancellableController } from '@matrixai/async-cancellable';
import type { RWLockReader, RWLockWriter, LockBox } from '@matrixai/async-locks';
import { Timer } from '@matrixai/timer';
import { Monitor } from '@matrixai/async-locks';
declare const AsyncFunction: Function;

@@ -21,2 +23,5 @@ declare const GeneratorFunction: Function;

}, delay?: number, lazy?: boolean, controller?: PromiseCancellableController): ResourceAcquire<Timer<T>>;
declare function monitor<RWLock extends RWLockReader | RWLockWriter>(lockBox: LockBox<RWLock>, lockConstructor: new () => RWLock, locksPending?: Map<string, {
count: number;
}>): ResourceAcquire<Monitor<RWLock>>;
declare function isPromiseLike(v: any): v is PromiseLike<unknown>;

@@ -33,2 +38,2 @@ /**

declare function isAsyncGenerator(v: any): v is AsyncGenerator<unknown>;
export { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction, contexts, getContextIndex, checkContextCancellable, checkContextTimed, timer, isPromiseLike, isGenerator, isAsyncGenerator, };
export { AsyncFunction, GeneratorFunction, AsyncGeneratorFunction, contexts, getContextIndex, checkContextCancellable, checkContextTimed, timer, monitor, isPromiseLike, isGenerator, isAsyncGenerator, };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAsyncGenerator = exports.isGenerator = exports.isPromiseLike = exports.timer = exports.checkContextTimed = exports.checkContextCancellable = exports.getContextIndex = exports.contexts = exports.AsyncGeneratorFunction = exports.GeneratorFunction = exports.AsyncFunction = void 0;
exports.isAsyncGenerator = exports.isGenerator = exports.isPromiseLike = exports.monitor = exports.timer = exports.checkContextTimed = exports.checkContextCancellable = exports.getContextIndex = exports.contexts = exports.AsyncGeneratorFunction = exports.GeneratorFunction = exports.AsyncFunction = void 0;
const timer_1 = require("@matrixai/timer");
const async_locks_1 = require("@matrixai/async-locks");
const AsyncFunction = (async () => { }).constructor;

@@ -65,2 +66,14 @@ exports.AsyncFunction = AsyncFunction;

exports.timer = timer;
function monitor(lockBox, lockConstructor, locksPending) {
return async () => {
const monitor = new async_locks_1.Monitor(lockBox, lockConstructor, locksPending);
return [
async () => {
await monitor.unlockAll();
},
monitor,
];
};
}
exports.monitor = monitor;
function isPromiseLike(v) {

@@ -67,0 +80,0 @@ return v != null && typeof v.then === 'function';

2

package.json
{
"name": "@matrixai/contexts",
"version": "1.1.0",
"version": "1.2.0",
"author": "Roger Qiu",

@@ -5,0 +5,0 @@ "description": "Asynchronous contexts",

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