You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@vect/column-mapper

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 0.0.6

48

dist/index.cjs.js

@@ -25,3 +25,51 @@ 'use strict';

function columnMapper(mx, fn, l) {
const {
y
} = this;
l = l || mx && mx.length;
const mt = Array(l);
for (let r; --l >= 0 && (r = mx[l].slice());) {
r[y] = fn(r[y], l);
mt[l] = r;
}
return mt;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = y => columnMapper.bind({
y
});
function columnMutate(mx, fn, l) {
const {
y
} = this;
l = l || mx && mx.length;
for (let r; --l >= 0 && (r = mx[l]);) r[y] = fn(r[y], l);
return mx;
}
/**
* Return a mutate function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMutate = y => columnMutate.bind({
y
});
exports.ColumnMapper = ColumnMapper;
exports.ColumnMutate = ColumnMutate;
exports.mapper = mapper;
exports.mutate = mutate;

48

dist/index.esm.js

@@ -21,2 +21,48 @@ function mapper(mx, y, fn, l) {

export { mapper, mutate };
function columnMapper(mx, fn, l) {
const {
y
} = this;
l = l || mx && mx.length;
const mt = Array(l);
for (let r; --l >= 0 && (r = mx[l].slice());) {
r[y] = fn(r[y], l);
mt[l] = r;
}
return mt;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = y => columnMapper.bind({
y
});
function columnMutate(mx, fn, l) {
const {
y
} = this;
l = l || mx && mx.length;
for (let r; --l >= 0 && (r = mx[l]);) r[y] = fn(r[y], l);
return mx;
}
/**
* Return a mutate function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMutate = y => columnMutate.bind({
y
});
export { ColumnMapper, ColumnMutate, mapper, mutate };

4

package.json
{
"name": "@vect/column-mapper",
"version": "0.0.5",
"version": "0.0.6",
"description": "A debugging tool",

@@ -33,3 +33,3 @@ "main": "dist/index.cjs.js",

"homepage": "https://github.com/hoyeungw/vect#readme",
"gitHead": "36e42f9ffcac1f1214dcd09fd98ee1130f35eaf2"
"gitHead": "6d6f9624d5516ae3b57214985feb10f35a4b0e40"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc