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

@enterprise_search/kleislis

Package Overview
Dependencies
Maintainers
0
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enterprise_search/kleislis - npm Package Compare versions

Comparing version 0.8.9 to 0.8.10

4

dist/src/async.d.ts

@@ -7,3 +7,5 @@ import { ConcurrencyLimits } from "./concurrency.limiter";

export declare function asyncSource<T>(source: T[]): AsyncGenerator<T>;
export declare function mapAsync<T, R>(generator: AsyncGenerator<T>, mapFunc: (value: T) => Promise<R>, config: AsyncConfig): Promise<R[]>;
export declare function asyncTestSource<T>(n: number, generatorFunc: (i: number) => T): AsyncGenerator<T>;
export declare function mapAsyncToAsync<T, R>(generator: AsyncGenerator<T>, mapFunc: (value: T, count: number) => Promise<R>): AsyncGenerator<R>;
export declare function mapAsync<T, R>(generator: AsyncGenerator<T>, mapFunc: (value: T, count: number) => Promise<R>, config: AsyncConfig): Promise<R[]>;
export declare function collectAsync<T, R>(generator: AsyncGenerator<T>, filterFunc: (value: T) => boolean, mapFunc: (value: T) => Promise<R>, config: AsyncConfig): Promise<R[]>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.asyncSource = asyncSource;
exports.asyncTestSource = asyncTestSource;
exports.mapAsyncToAsync = mapAsyncToAsync;
exports.mapAsync = mapAsync;

@@ -13,2 +15,13 @@ exports.collectAsync = collectAsync;

}
async function* asyncTestSource(n, generatorFunc) {
for (let i = 0; i < n; i++) {
yield generatorFunc(i);
}
}
async function* mapAsyncToAsync(generator, mapFunc) {
let count = 0;
for await (const value of generator) {
yield await mapFunc(value, count++);
}
}
async function mapAsync(generator, mapFunc, config) {

@@ -18,2 +31,3 @@ const promises = [];

let finished = false;
let count = 0;
return new Promise(async (resolve, reject) => {

@@ -33,3 +47,3 @@ async function addPromise() {

active++;
promises.push(mapFunc(value).finally(() => {
promises.push(mapFunc(value, count++).finally(() => {
active--;

@@ -36,0 +50,0 @@ setImmediate(addPromise);

{
"name": "@enterprise_search/kleislis",
"description": "functions that have inputs, returns promises, and non functionals around them",
"version": "0.8.9",
"version": "0.8.10",
"main": "dist/index",

@@ -6,0 +6,0 @@ "types": "dist/index",

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