@apofasi/core
Advanced tools
Comparing version 0.6.4 to 0.7.0
{ | ||
"name": "@apofasi/core", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@js-temporal/polyfill": "^0.4.4", |
@@ -17,2 +17,3 @@ export declare class ApofasiCoreModule { | ||
export { mapAsyncSeries } from './lib/util/collection/map-async-series'; | ||
export { forEachAsyncSeries } from './lib/util/collection/for-each-async-series'; | ||
export { wrap } from './lib/util/string/wrap'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.wrap = exports.mapAsyncSeries = exports.filterNotNull = exports.MultiDimensionalCache = exports.LazyProperty = exports.LazyAsyncProperty = exports.BeanContainer = exports.Context = exports.ApofasiCoreModule = void 0; | ||
exports.wrap = exports.forEachAsyncSeries = exports.mapAsyncSeries = exports.filterNotNull = exports.MultiDimensionalCache = exports.LazyProperty = exports.LazyAsyncProperty = exports.BeanContainer = exports.Context = exports.ApofasiCoreModule = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -34,4 +34,6 @@ const path = require("node:path"); | ||
Object.defineProperty(exports, "mapAsyncSeries", { enumerable: true, get: function () { return map_async_series_1.mapAsyncSeries; } }); | ||
var for_each_async_series_1 = require("./lib/util/collection/for-each-async-series"); | ||
Object.defineProperty(exports, "forEachAsyncSeries", { enumerable: true, get: function () { return for_each_async_series_1.forEachAsyncSeries; } }); | ||
var wrap_1 = require("./lib/util/string/wrap"); | ||
Object.defineProperty(exports, "wrap", { enumerable: true, get: function () { return wrap_1.wrap; } }); | ||
//# sourceMappingURL=index.js.map |
export declare const mapAsyncSeries: unique symbol; | ||
declare global { | ||
interface Array<T> { | ||
readonly [mapAsyncSeries]: <U>(iteratee: (it: T) => Promise<U>) => Promise<U[]>; | ||
readonly [mapAsyncSeries]: <U>(iteratee: (it: T, index: number) => Promise<U>) => Promise<U[]>; | ||
} | ||
} |
@@ -7,5 +7,5 @@ "use strict"; | ||
Object.defineProperty(Array.prototype, exports.mapAsyncSeries, { | ||
value(iterateee) { | ||
return this.reduce(async (prev, item) => { | ||
return (await prev).concat(await iterateee(item)); | ||
value(iteratee) { | ||
return this.reduce(async (prev, item, currentIndex) => { | ||
return [...(await prev), await iteratee(item, currentIndex)]; | ||
}, Promise.resolve([])); | ||
@@ -12,0 +12,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80654
131
1228