Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
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

@vect/column-mapper - npm Package Compare versions

Comparing version 0.1.15 to 0.1.18

74

dist/index.cjs.js

@@ -11,2 +11,39 @@ 'use strict';

function columnMapperDuplicate(mx, fn, l) {
l = l || mx && mx.length;
const mt = Array(l);
for (let i = 0, r, {
y
} = this; i < l; i++) {
mt[i] = r = mx[i].slice();
r[y] = fn(r[y], i);
}
return mt;
}
function columnMapper(mx, fn, l) {
l = l || mx && mx.length;
const vec = Array(l);
for (let i = 0, {
y
} = this; i < l; i++) vec[i] = fn(mx[i][y], i);
return vec;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @param {boolean=true} [duplicate] - true if duplicate original matrix form
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = (y, duplicate = true) => duplicate ? columnMapperDuplicate.bind({
y
}) : columnMapper.bind({
y
});
const mapper = (mx, y, fn, l) => columnMapper.call({

@@ -63,39 +100,2 @@ y

function columnMapperDuplicate(mx, fn, l) {
l = l || mx && mx.length;
const mt = Array(l);
for (let i = 0, r, {
y
} = this; i < l; i++) {
mt[i] = r = mx[i].slice();
r[y] = fn(r[y], i);
}
return mt;
}
function columnMapper$1(mx, fn, l) {
l = l || mx && mx.length;
const vec = Array(l);
for (let i = 0, {
y
} = this; i < l; i++) vec[i] = fn(mx[i][y], i);
return vec;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @param {boolean=true} [duplicate] - true if duplicate original matrix form
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = (y, duplicate = true) => duplicate ? columnMapperDuplicate.bind({
y
}) : columnMapper$1.bind({
y
});
exports.ColumnIterate = ColumnIterate;

@@ -102,0 +102,0 @@ exports.ColumnMapper = ColumnMapper;

@@ -7,2 +7,39 @@ const iterate = function (mx, y, fn, l) {

function columnMapperDuplicate(mx, fn, l) {
l = l || mx && mx.length;
const mt = Array(l);
for (let i = 0, r, {
y
} = this; i < l; i++) {
mt[i] = r = mx[i].slice();
r[y] = fn(r[y], i);
}
return mt;
}
function columnMapper(mx, fn, l) {
l = l || mx && mx.length;
const vec = Array(l);
for (let i = 0, {
y
} = this; i < l; i++) vec[i] = fn(mx[i][y], i);
return vec;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @param {boolean=true} [duplicate] - true if duplicate original matrix form
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = (y, duplicate = true) => duplicate ? columnMapperDuplicate.bind({
y
}) : columnMapper.bind({
y
});
const mapper = (mx, y, fn, l) => columnMapper.call({

@@ -59,39 +96,2 @@ y

function columnMapperDuplicate(mx, fn, l) {
l = l || mx && mx.length;
const mt = Array(l);
for (let i = 0, r, {
y
} = this; i < l; i++) {
mt[i] = r = mx[i].slice();
r[y] = fn(r[y], i);
}
return mt;
}
function columnMapper$1(mx, fn, l) {
l = l || mx && mx.length;
const vec = Array(l);
for (let i = 0, {
y
} = this; i < l; i++) vec[i] = fn(mx[i][y], i);
return vec;
}
/**
* Return a mapper function that iterate through each element in column indexed by 'y'.
* @param {number} y
* @param {boolean=true} [duplicate] - true if duplicate original matrix form
* @returns {function(*[][],function(*):*,[number]):*[][]}
* @constructor
*/
const ColumnMapper = (y, duplicate = true) => duplicate ? columnMapperDuplicate.bind({
y
}) : columnMapper$1.bind({
y
});
export { ColumnIterate, ColumnMapper, ColumnMutate, iterate, mapper, mutate };
{
"name": "@vect/column-mapper",
"version": "0.1.15",
"version": "0.1.18",
"description": "A debugging tool",

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

"homepage": "https://github.com/hoyeungw/vect#readme",
"gitHead": "1b843fe2db07f22e9c8dd7ab2a2b28497c6a964c"
"gitHead": "42f272eda481b27ce0a2365a3ef4612e6cfcb2aa"
}
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