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

lightning-pool

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-pool - npm Package Compare versions

Comparing version 2.1.12 to 2.1.13

2

lib/index.d.ts

@@ -10,2 +10,2 @@ import {Pool, IPoolFactory} from './Pool';

export function createPool(factory: IPoolFactory, options: PoolOptions): Pool;
export function createPool<T = any>(factory: IPoolFactory<T>, options: PoolOptions): Pool<T>;

@@ -1,6 +0,3 @@

/// <reference lib="es2015.symbol" />
type Maybe<T> = T | void;
import {PoolOptions} from "./PoolOptions";
import {EventEmitter} from 'events';

@@ -14,13 +11,13 @@ export enum PoolState {

export interface IPoolFactory {
create(info: { tries: number, maxRetries: number }): Promise<any> | any;
export interface IPoolFactory<T> {
create(info: { tries: number, maxRetries: number }): Promise<T> | T;
destroy(resource: any): Promise<void>;
destroy(resource: T): Promise<void> | void;
reset(resource: any): Promise<void>;
reset(resource: T): Promise<void> | void;
validate(resource: any): Promise<void>;
validate(resource: T): Promise<void> | void;
}
export class Pool {
export class Pool<T = any> extends EventEmitter {
public readonly acquired: number;

@@ -34,14 +31,16 @@ public readonly available: number;

acquire(): Promise<any>;
acquire(callback: (resource: any) => void): void;
constructor(factory: IPoolFactory<T>, options?: PoolOptions);
isAcquired(resource: any): boolean;
acquire(): Promise<T>;
acquire(callback: (resource: T) => void): void;
includes(resource: any): boolean;
isAcquired(resource: T): boolean;
release(resource: any): Promise<void>;
release(resource: any, callback: () => void): void;
includes(resource: T): boolean;
destroy(resource: any): void;
release(resource: T): Promise<void>;
release(resource: T, callback: () => void): void;
destroy(resource: T): void;
start(): void;

@@ -48,0 +47,0 @@

@@ -205,3 +205,2 @@ /* lightning-pool

this._acquireNext();
}

@@ -208,0 +207,0 @@

{
"name": "lightning-pool",
"description": "Fastest object pool implementation for JavaScript",
"version": "2.1.12",
"version": "2.1.13",
"author": "Panates Ltd.",

@@ -21,2 +21,3 @@ "contributors": [

"devDependencies": {
"@types/node": "^14.11.2",
"eslint": "^7.9.0",

@@ -23,0 +24,0 @@ "eslint-config-google": "^0.14.0",

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