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

@ts-common/iterator

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-common/iterator - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

4

dist/index.d.ts

@@ -27,3 +27,3 @@ export interface IteratorResult<T> {

readonly last: () => T | undefined;
readonly some: (func: (v: T, i: number) => boolean) => boolean;
readonly some: (func?: (v: T, i: number) => boolean) => boolean;
readonly every: (func: (v: T, i: number) => boolean) => boolean;

@@ -60,3 +60,3 @@ readonly zip: (...inputs: readonly (Iterable<T> | undefined)[]) => IterableEx<readonly T[]>;

export declare const last: <T>(input: Iterable<T> | undefined) => T | undefined;
export declare const some: <T>(input: Iterable<T> | undefined, func: (v: T, i: number) => boolean) => boolean;
export declare const some: <T>(input: Iterable<T> | undefined, func?: (v: T, i: number) => boolean) => boolean;
export declare const every: <T>(input: Iterable<T> | undefined, func: (v: T, i: number) => boolean) => boolean;

@@ -63,0 +63,0 @@ export declare const forEach: <T>(input: Iterable<T> | undefined, func: (v: T, i: number) => void) => void;

@@ -119,3 +119,3 @@ "use strict";

exports.last = (input) => exports.reduce(input, (_, v) => v);
exports.some = (input, func) => exports.findEntry(input, func) !== undefined;
exports.some = (input, func = () => true) => exports.findEntry(input, func) !== undefined;
exports.every = (input, func) => !exports.some(input, (v, i) => !func(v, i));

@@ -122,0 +122,0 @@ exports.forEach = (input, func) =>

{
"name": "@ts-common/iterator",
"version": "0.3.0",
"version": "0.3.1",
"description": "Iterator library for JavaScript and TypeScript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -30,3 +30,3 @@ export interface IteratorResult<T> {

readonly last: () => T|undefined
readonly some: (func: (v: T, i: number) => boolean) => boolean
readonly some: (func?: (v: T, i: number) => boolean) => boolean
readonly every: (func: (v: T, i: number) => boolean) => boolean

@@ -65,3 +65,3 @@ readonly zip: (...inputs: readonly (Iterable<T>|undefined)[]) => IterableEx<readonly T[]>

public reverse() { return reverse(this) }
public some(func: (v: T, i: number) => boolean) { return some(this, func) }
public some(func?: (v: T, i: number) => boolean) { return some(this, func) }
public take(n?: number) { return take(this, n) }

@@ -233,3 +233,3 @@ public takeWhile(func: (v: T, i: number) => boolean) { return takeWhile(this, func) }

input: Iterable<T>|undefined,
func: (v: T, i: number) => boolean,
func: (v: T, i: number) => boolean = () => true,
): boolean =>

@@ -236,0 +236,0 @@ findEntry(input, func) !== undefined

Sorry, the diff of this file is not supported yet

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