Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vect/matrix-quantifier

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vect/matrix-quantifier - npm Package Compare versions

Comparing version 0.0.24 to 0.0.25

22

dist/index.cjs.js

@@ -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"
}
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