@vect/matrix-mapper
Advanced tools
Comparing version 0.2.0 to 0.2.2
@@ -49,5 +49,14 @@ 'use strict'; | ||
}; | ||
const selectMutate = (mx, ys, fn, h) => { | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length); | ||
const depth = ys.length; | ||
for (let i = 0, y, r, j; i < h; i++) for (y = 0, r = mx[i]; y < depth; y++) r[j = ys[y]] = fn(r[j], i, j); | ||
return mx; | ||
}; | ||
exports.iterate = iterate; | ||
exports.mapper = mapper; | ||
exports.mutate = mutate; | ||
exports.selectMutate = selectMutate; |
@@ -45,3 +45,11 @@ /** | ||
}; | ||
const selectMutate = (mx, ys, fn, h) => { | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length); | ||
const depth = ys.length; | ||
export { iterate, mapper, mutate }; | ||
for (let i = 0, y, r, j; i < h; i++) for (y = 0, r = mx[i]; y < depth; y++) r[j = ys[y]] = fn(r[j], i, j); | ||
return mx; | ||
}; | ||
export { iterate, mapper, mutate, selectMutate }; |
{ | ||
"name": "@vect/matrix-mapper", | ||
"version": "0.2.0", | ||
"version": "0.2.2", | ||
"description": "A debugging tool", | ||
@@ -33,3 +33,3 @@ "main": "dist/index.cjs.js", | ||
"homepage": "https://github.com/hoyeungw/vect#readme", | ||
"gitHead": "bde0768b1880639795b74bf09f73178c1ac32f87" | ||
"gitHead": "2548485b4d33272c4175da8792f3847e5b1d6ee3" | ||
} |
6708
87