@vect/vector-mapper
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -5,15 +5,13 @@ 'use strict'; | ||
const mapper = (ar, fn, l) => { | ||
l = l || ar && ar.length; | ||
const vec = Array(l); | ||
const iterate = function (vec, fn, l) { | ||
l = l || vec && vec.length; | ||
for (--l; l >= 0; l--) vec[l] = fn(ar[l], l); | ||
return vec; | ||
for (let i = 0; i < l; i++) fn.call(this, vec[i], l); | ||
}; | ||
const mutate = (ar, fn, l) => { | ||
l = l || ar && ar.length; | ||
const mapper = (vec, fn, l) => { | ||
l = l || vec && vec.length; | ||
const ar = Array(l); | ||
for (--l; l >= 0; l--) ar[l] = fn(ar[l], l); | ||
for (--l; l >= 0; l--) ar[l] = fn.call(undefined, vec[l], l); | ||
@@ -23,3 +21,12 @@ return ar; | ||
const mutate = (vec, fn, l) => { | ||
l = l || vec && vec.length; | ||
for (--l; l >= 0; l--) vec[l] = fn(vec[l], l); | ||
return vec; | ||
}; | ||
exports.iterate = iterate; | ||
exports.mapper = mapper; | ||
exports.mutate = mutate; |
@@ -1,14 +0,12 @@ | ||
const mapper = (ar, fn, l) => { | ||
l = l || ar && ar.length; | ||
const vec = Array(l); | ||
const iterate = function (vec, fn, l) { | ||
l = l || vec && vec.length; | ||
for (--l; l >= 0; l--) vec[l] = fn(ar[l], l); | ||
return vec; | ||
for (let i = 0; i < l; i++) fn.call(this, vec[i], l); | ||
}; | ||
const mutate = (ar, fn, l) => { | ||
l = l || ar && ar.length; | ||
const mapper = (vec, fn, l) => { | ||
l = l || vec && vec.length; | ||
const ar = Array(l); | ||
for (--l; l >= 0; l--) ar[l] = fn(ar[l], l); | ||
for (--l; l >= 0; l--) ar[l] = fn.call(undefined, vec[l], l); | ||
@@ -18,2 +16,10 @@ return ar; | ||
export { mapper, mutate }; | ||
const mutate = (vec, fn, l) => { | ||
l = l || vec && vec.length; | ||
for (--l; l >= 0; l--) vec[l] = fn(vec[l], l); | ||
return vec; | ||
}; | ||
export { iterate, mapper, mutate }; |
{ | ||
"name": "@vect/vector-mapper", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "A debugging tool", | ||
@@ -33,3 +33,3 @@ "main": "dist/index.cjs.js", | ||
"homepage": "https://github.com/hoyeungw/vect#readme", | ||
"gitHead": "b066d81d335749f62bedda436d0fe7854e78c026" | ||
"gitHead": "859849f307eddefac80bc064722d1816f2f930ad" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4511
36