Socket
Socket
Sign inDemoInstall

itertools

Package Overview
Dependencies
0
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.3 to 2.2.4

60

dist/index.d.ts

@@ -80,3 +80,3 @@ type Predicate<T> = (value: T) => boolean;

*/
declare function enumerate<T>(iterable: Iterable<T>, start?: number): Iterable<[number, T]>;
declare function enumerate<T>(iterable: Iterable<T>, start?: number): IterableIterator<[number, T]>;
/**

@@ -146,4 +146,4 @@ * Non-lazy version of ifilter().

*/
declare function range(stop: number): Iterable<number>;
declare function range(start: number, stop: number, step?: number): Iterable<number>;
declare function range(stop: number): IterableIterator<number>;
declare function range(start: number, stop: number, step?: number): IterableIterator<number>;
/**

@@ -206,3 +206,3 @@ * Apply function of two arguments cumulatively to the items of sequence, from

*/
declare function chain<T>(...iterables: Iterable<T>[]): Iterable<T>;
declare function chain<T>(...iterables: Iterable<T>[]): IterableIterator<T>;
/**

@@ -213,3 +213,3 @@ * Returns an iterator that counts up values starting with number `start`

*/
declare function count(start?: number, step?: number): Iterable<number>;
declare function count(start?: number, step?: number): IterableIterator<number>;
/**

@@ -224,3 +224,3 @@ * Non-lazy version of icompress().

*/
declare function cycle<T>(iterable: Iterable<T>): Iterable<T>;
declare function cycle<T>(iterable: Iterable<T>): IterableIterator<T>;
/**

@@ -232,3 +232,3 @@ * Returns an iterator that drops elements from the iterable as long as the

*/
declare function dropwhile<T>(iterable: Iterable<T>, predicate: Predicate<T>): Iterable<T>;
declare function dropwhile<T>(iterable: Iterable<T>, predicate: Predicate<T>): IterableIterator<T>;
declare function groupby<T, K extends Primitive>(iterable: Iterable<T>, keyFn?: (item: T) => K): Generator<[K, Generator<T, undefined>], undefined>;

@@ -240,3 +240,3 @@ /**

*/
declare function icompress<T>(data: Iterable<T>, selectors: Iterable<boolean>): Iterable<T>;
declare function icompress<T>(data: Iterable<T>, selectors: Iterable<boolean>): IterableIterator<T>;
/**

@@ -246,4 +246,4 @@ * Returns an iterator that filters elements from iterable returning only those

*/
declare function ifilter<T, N extends T>(iterable: Iterable<T>, predicate: (item: T) => item is N): Iterable<N>;
declare function ifilter<T>(iterable: Iterable<T>, predicate: Predicate<T>): Iterable<T>;
declare function ifilter<T, N extends T>(iterable: Iterable<T>, predicate: (item: T) => item is N): IterableIterator<N>;
declare function ifilter<T>(iterable: Iterable<T>, predicate: Predicate<T>): IterableIterator<T>;
/**

@@ -253,3 +253,3 @@ * Returns an iterator that computes the given mapper function using arguments

*/
declare function imap<T, V>(iterable: Iterable<T>, mapper: (item: T) => V): Iterable<V>;
declare function imap<T, V>(iterable: Iterable<T>, mapper: (item: T) => V): IterableIterator<V>;
/**

@@ -264,4 +264,4 @@ * Returns an iterator that returns selected elements from the iterable. If

*/
declare function islice<T>(iterable: Iterable<T>, stop: number): Iterable<T>;
declare function islice<T>(iterable: Iterable<T>, start: number, stop?: number | null, step?: number): Iterable<T>;
declare function islice<T>(iterable: Iterable<T>, stop: number): IterableIterator<T>;
declare function islice<T>(iterable: Iterable<T>, start: number, stop?: number | null, step?: number): IterableIterator<T>;
/**

@@ -273,8 +273,8 @@ * Returns an iterator that aggregates elements from each of the iterables.

*/
declare function izip2<T1, T2>(xs: Iterable<T1>, ys: Iterable<T2>): Iterable<[T1, T2]>;
declare function izip<T1, T2>(xs: Iterable<T1>, ys: Iterable<T2>): IterableIterator<[T1, T2]>;
/**
* Like izip2, but for three input iterables.
*/
declare function izip3<T1, T2, T3>(xs: Iterable<T1>, ys: Iterable<T2>, zs: Iterable<T3>): Iterable<[T1, T2, T3]>;
declare const izip: typeof izip2;
declare function izip3<T1, T2, T3>(xs: Iterable<T1>, ys: Iterable<T2>, zs: Iterable<T3>): IterableIterator<[T1, T2, T3]>;
declare const izip2: typeof izip;
/**

@@ -285,3 +285,3 @@ * Returns an iterator that aggregates elements from each of the iterables. If

*/
declare function izipLongest2<T1, T2, D>(xs: Iterable<T1>, ys: Iterable<T2>, filler?: D): Iterable<[T1 | D, T2 | D]>;
declare function izipLongest2<T1, T2, D>(xs: Iterable<T1>, ys: Iterable<T2>, filler?: D): IterableIterator<[T1 | D, T2 | D]>;
/**

@@ -295,3 +295,3 @@ * Like the other izips (`izip`, `izip3`, etc), but generalized to take an

*/
declare function izipMany<T>(...iters: Iterable<T>[]): Iterable<T[]>;
declare function izipMany<T>(...iters: Iterable<T>[]): IterableIterator<T[]>;
/**

@@ -310,3 +310,3 @@ * Return successive `r`-length permutations of elements in the iterable.

*/
declare function permutations<T>(iterable: Iterable<T>, r?: number): Iterable<T[]>;
declare function permutations<T>(iterable: Iterable<T>, r?: number): IterableIterator<T[]>;
/**

@@ -316,3 +316,3 @@ * Returns an iterator that produces elements from the iterable as long as the

*/
declare function takewhile<T>(iterable: Iterable<T>, predicate: Predicate<T>): Iterable<T>;
declare function takewhile<T>(iterable: Iterable<T>, predicate: Predicate<T>): IterableIterator<T>;
declare function zipLongest2<T1, T2, D>(xs: Iterable<T1>, ys: Iterable<T2>, filler?: D): Array<[T1 | D, T2 | D]>;

@@ -335,3 +335,3 @@ declare const izipLongest: typeof izipLongest2;

*/
declare function chunked<T>(iterable: Iterable<T>, size: number): Iterable<T[]>;
declare function chunked<T>(iterable: Iterable<T>, size: number): IterableIterator<T[]>;
/**

@@ -344,3 +344,3 @@ * Return an iterator flattening one level of nesting in a list of lists:

*/
declare function flatten<T>(iterableOfIterables: Iterable<Iterable<T>>): Iterable<T>;
declare function flatten<T>(iterableOfIterables: Iterable<Iterable<T>>): IterableIterator<T>;
/**

@@ -350,3 +350,3 @@ * Returns an iterable containing only the first `n` elements of the given

*/
declare function itake<T>(n: number, iterable: Iterable<T>): Iterable<T>;
declare function itake<T>(n: number, iterable: Iterable<T>): IterableIterator<T>;
/**

@@ -361,3 +361,3 @@ * Returns an iterator of paired items, overlapping, from the original. When

*/
declare function pairwise<T>(iterable: Iterable<T>): Iterable<[T, T]>;
declare function pairwise<T>(iterable: Iterable<T>): IterableIterator<[T, T]>;
/**

@@ -386,3 +386,3 @@ * Returns a 2-tuple of arrays. Splits the elements in the input iterable into

*/
declare function roundrobin<T>(...iters: Iterable<T>[]): Iterable<T>;
declare function roundrobin<T>(...iters: Iterable<T>[]): IterableIterator<T>;
/**

@@ -399,3 +399,3 @@ * Yields the heads of all of the given iterables. This is almost like

*/
declare function heads<T>(...iters: Array<Iterable<T>>): Iterable<T[]>;
declare function heads<T>(...iters: Array<Iterable<T>>): IterableIterator<T[]>;
/**

@@ -414,3 +414,3 @@ * Non-lazy version of itake().

*/
declare function uniqueEverseen<T>(iterable: Iterable<T>, keyFn?: (item: T) => Primitive): Iterable<T>;
declare function uniqueEverseen<T>(iterable: Iterable<T>, keyFn?: (item: T) => Primitive): IterableIterator<T>;
/**

@@ -425,3 +425,3 @@ * Yields elements in order, ignoring serial duplicates.

*/
declare function uniqueJustseen<T>(iterable: Iterable<T>, keyFn?: (item: T) => Primitive): Iterable<T>;
declare function uniqueJustseen<T>(iterable: Iterable<T>, keyFn?: (item: T) => Primitive): IterableIterator<T>;

@@ -436,3 +436,3 @@ /**

*/
declare function icompact<T>(iterable: Iterable<T | null | undefined>): Iterable<T>;
declare function icompact<T>(iterable: Iterable<T | null | undefined>): IterableIterator<T>;
/**

@@ -476,4 +476,4 @@ * Returns an array, filtering out any "nullish" values from the iterable.

*/
declare function flatmap<T, S>(iterable: Iterable<T>, mapper: (item: T) => Iterable<S>): Iterable<S>;
declare function flatmap<T, S>(iterable: Iterable<T>, mapper: (item: T) => Iterable<S>): IterableIterator<S>;
export { type Predicate, type Primitive, all, any, chain, chunked, compact, compactObject, compress, contains, count, cycle, dropwhile, enumerate, every, filter, find, first, flatmap, flatten, groupby, heads, icompact, icompress, ifilter, imap, islice, itake, iter, izip, izip2, izip3, izipLongest, izipMany, map, max, min, pairwise, partition, permutations, range, reduce, roundrobin, some, sorted, sum, take, takewhile, uniqueEverseen, uniqueJustseen, zip, zip3, zipLongest, zipMany };

@@ -273,3 +273,3 @@ // src/utils.ts

}
function* izip2(xs, ys) {
function* izip(xs, ys) {
const ixs = iter(xs);

@@ -302,3 +302,3 @@ const iys = iter(ys);

}
var izip = izip2;
var izip2 = izip;
function* izipLongest2(xs, ys, filler) {

@@ -419,3 +419,3 @@ const filler_ = filler;

}
function* enumerate2(iterable, start = 0) {
function* enumerate(iterable, start = 0) {
let index = start;

@@ -536,3 +536,3 @@ for (const value of iterable) {

dropwhile,
enumerate2 as enumerate,
enumerate,
every,

@@ -539,0 +539,0 @@ filter,

{
"name": "itertools",
"version": "2.2.3",
"version": "2.2.4",
"description": "A JavaScript port of Python's awesome itertools standard library",

@@ -52,17 +52,16 @@ "license": "MIT",

"devDependencies": {
"@arethetypeswrong/cli": "^0.13.5",
"@arethetypeswrong/cli": "^0.13.10",
"@release-it/keep-a-changelog": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-istanbul": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitest/coverage-istanbul": "^1.3.0",
"eslint": "^8.56.0",
"fast-check": "^3.15.0",
"in-publish": "^2.0.1",
"prettier": "^3.1.1",
"fast-check": "^3.15.1",
"prettier": "^3.2.5",
"publint": "^0.2.7",
"release-it": "^17.0.1",
"tsup": "^8.0.1",
"release-it": "^17.1.1",
"tsup": "^8.0.2",
"typescript": "^5.3.3",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.1.3"
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.3.0"
},

@@ -69,0 +68,0 @@ "githubUrl": "https://github.com/nvie/itertools",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc