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

arrayq

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrayq - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

2

es6/count.d.ts
import { ItemPredicate } from './types';
export default function count<T>(items: T[], predicate: ItemPredicate<T>): number;
export default function count<T>(items: T[], predicate?: ItemPredicate<T>): number;
"use strict";
function count(items, predicate) {
let count = 0;
for (var i = 0, ii = items.length; i < ii; i++) {
count = count + (predicate(items[i], i, items) ? 1 : 0);
if (predicate) {
let count = 0;
for (var i = 0, ii = items.length; i < ii; i++) {
count = count + (predicate(items[i], i, items) ? 1 : 0);
}
return count;
}
return count;
else {
return items.length;
}
}

@@ -9,0 +14,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

import { ItemPredicate } from './types';
export default function count<T>(items: T[], predicate: ItemPredicate<T>): number {
export default function count<T>(items: T[], predicate?: ItemPredicate<T>): number {
if (predicate) {
let count = 0;
for (var i = 0, ii = items.length; i < ii; i++) {
count = count + (predicate(items[i], i, items) ? 1 : 0);
count = count + (predicate(items[i], i, items) ? 1 : 0);
}
return count;
} else {
return items.length;
}
}
{
"name": "arrayq",
"version": "0.1.10",
"version": "0.1.11",
"description": "Array query methods for Node.js",

@@ -5,0 +5,0 @@ "main": "es6/prototype.js",

Sorry, the diff of this file is not supported yet

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