@proem/array
Advanced tools
Comparing version 0.0.6 to 0.0.12
@@ -15,3 +15,7 @@ export declare const map: { | ||
declare function filterPartial<A>(predicate: (value: A) => boolean): (array: A[]) => A[]; | ||
export declare const reduce: { | ||
<A, R>(array: A[], initial: R, reducer: (acc: R, value: A) => R): R; | ||
partial<A, R>(reducer: (acc: R, value: A) => R): (initial: R) => (array: A[]) => R; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=array.d.ts.map |
@@ -1,2 +0,4 @@ | ||
export var map = function (array, mapfn) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.map = function (array, mapfn) { | ||
var result = new Array(array.length); | ||
@@ -8,6 +10,6 @@ for (var i = 0; i < array.length; i++) { | ||
}; | ||
map.partial = function (mapFn) { return function (array) { | ||
return map(array, mapFn); | ||
exports.map.partial = function (mapFn) { return function (array) { | ||
return exports.map(array, mapFn); | ||
}; }; | ||
export function filter(array, predicate) { | ||
function filter(array, predicate) { | ||
var result = []; | ||
@@ -22,2 +24,3 @@ for (var i = 0; i < array.length; i++) { | ||
} | ||
exports.filter = filter; | ||
function filterPartial(predicate) { | ||
@@ -27,2 +30,10 @@ return function (array) { return filter(array, predicate); }; | ||
filter.partial = filterPartial; | ||
exports.reduce = function (array, initial, reducer) { | ||
var result = initial; | ||
for (var i = 0; i < array.length; i++) { | ||
result = reducer(result, array[i]); | ||
} | ||
return result; | ||
}; | ||
exports.reduce.partial = function (reducer) { return function (initial) { return function (array) { return exports.reduce(array, initial, reducer); }; }; }; | ||
//# sourceMappingURL=array.js.map |
{ | ||
"name": "@proem/array", | ||
"version": "0.0.6", | ||
"version": "0.0.12", | ||
"description": "Typescript array utilities", | ||
@@ -15,3 +15,4 @@ "keywords": [ | ||
"main": "lib/array.js", | ||
"typings": "lib/array.d.ts", | ||
"module": "esm/array.js", | ||
"types": "lib/array.d.ts", | ||
"directories": { | ||
@@ -24,15 +25,15 @@ "lib": "lib" | ||
"files": [ | ||
"lib" | ||
"lib", | ||
"esm" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "tsc -b .", | ||
"build:commonjs": "tsc -b .", | ||
"build:esm": "tsc -b ./tsconfig.esm.json", | ||
"prepublishOnly": "npm run build:commonjs && npm run build:esm", | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"gitHead": "1abeefc25766642e465890a49d71c97ce7b914c6", | ||
"gitHead": "ed14680e3bb2277def8b798b17ce1e4d201ace6a", | ||
"devDependencies": { | ||
"typescript": "^3.1.4" | ||
}, | ||
"dependencies": { | ||
"typescript": "^3.1.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10416
0
105
- Removedtypescript@^3.1.4
- Removedtypescript@3.9.10(transitive)