@vect/matrix-quantifier
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -5,4 +5,2 @@ 'use strict'; | ||
var matrixSize = require('@vect/matrix-size'); | ||
/** | ||
@@ -13,9 +11,13 @@ * Return true if every element in a matrix matches the input criteria. | ||
* @param {function(*,number?,number?):*} crit | ||
* @param {number} [h] | ||
* @param {number} [w] | ||
* @returns {boolean} | ||
*/ | ||
const every = (mx, crit, h, w) => { | ||
var _mx$; | ||
const every = (mx, crit) => { | ||
const [ht, wd] = matrixSize.size(mx); | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length), w = w || h && ((_mx$ = mx[0]) === null || _mx$ === void 0 ? void 0 : _mx$.length); | ||
if (!w) return true; | ||
for (let i = 0, j, r; i < ht; i++) for (j = 0, r = mx[i]; j < wd; j++) if (!crit(r[j], i, j)) return false; | ||
for (let i = 0, j, r; i < h; i++) for (j = 0, r = mx[i]; j < w; j++) if (!crit(r[j], i, j)) return false; | ||
@@ -30,9 +32,13 @@ return true; | ||
* @param {function(*,number?,number?):*} crit | ||
* @param {number} [h] | ||
* @param {number} [w] | ||
* @returns {boolean} | ||
*/ | ||
const some = (mx, crit, h, w) => { | ||
var _mx$; | ||
const some = (mx, crit) => { | ||
const [ht, wd] = matrixSize.size(mx); | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length), w = w || h && ((_mx$ = mx[0]) === null || _mx$ === void 0 ? void 0 : _mx$.length); | ||
if (!w) return false; | ||
for (let i = 0, j, r; i < ht; i++) for (j = 0, r = mx[i]; j < wd; j++) if (crit(r[j], i, j)) return true; | ||
for (let i = 0, j, r; i < h; i++) for (j = 0, r = mx[i]; j < w; j++) if (crit(r[j], i, j)) return true; | ||
@@ -39,0 +45,0 @@ return false; |
@@ -1,3 +0,1 @@ | ||
import { size } from '@vect/matrix-size'; | ||
/** | ||
@@ -8,9 +6,13 @@ * Return true if every element in a matrix matches the input criteria. | ||
* @param {function(*,number?,number?):*} crit | ||
* @param {number} [h] | ||
* @param {number} [w] | ||
* @returns {boolean} | ||
*/ | ||
const every = (mx, crit, h, w) => { | ||
var _mx$; | ||
const every = (mx, crit) => { | ||
const [ht, wd] = size(mx); | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length), w = w || h && ((_mx$ = mx[0]) === null || _mx$ === void 0 ? void 0 : _mx$.length); | ||
if (!w) return true; | ||
for (let i = 0, j, r; i < ht; i++) for (j = 0, r = mx[i]; j < wd; j++) if (!crit(r[j], i, j)) return false; | ||
for (let i = 0, j, r; i < h; i++) for (j = 0, r = mx[i]; j < w; j++) if (!crit(r[j], i, j)) return false; | ||
@@ -25,9 +27,13 @@ return true; | ||
* @param {function(*,number?,number?):*} crit | ||
* @param {number} [h] | ||
* @param {number} [w] | ||
* @returns {boolean} | ||
*/ | ||
const some = (mx, crit, h, w) => { | ||
var _mx$; | ||
const some = (mx, crit) => { | ||
const [ht, wd] = size(mx); | ||
h = h || (mx === null || mx === void 0 ? void 0 : mx.length), w = w || h && ((_mx$ = mx[0]) === null || _mx$ === void 0 ? void 0 : _mx$.length); | ||
if (!w) return false; | ||
for (let i = 0, j, r; i < ht; i++) for (j = 0, r = mx[i]; j < wd; j++) if (crit(r[j], i, j)) return true; | ||
for (let i = 0, j, r; i < h; i++) for (j = 0, r = mx[i]; j < w; j++) if (crit(r[j], i, j)) return true; | ||
@@ -34,0 +40,0 @@ return false; |
{ | ||
"name": "@vect/matrix-quantifier", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Every and some for 2-array", | ||
@@ -21,5 +21,2 @@ "main": "dist/index.cjs.js", | ||
}, | ||
"dependencies": { | ||
"@vect/matrix-size": "^0.0.24" | ||
}, | ||
"keywords": [ | ||
@@ -39,3 +36,3 @@ "matrix", | ||
"homepage": "https://github.com/hoyeungw/vect#readme", | ||
"gitHead": "859849f307eddefac80bc064722d1816f2f930ad" | ||
"gitHead": "8c6ddf6bb50856583cdc81f29000f6303217f5da" | ||
} |
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
6326
0
69
- Removed@vect/matrix-size@^0.0.24
- Removed@vect/matrix-size@0.0.24(transitive)