@ts-common/iterator
Advanced tools
Comparing version
@@ -0,1 +1,13 @@ | ||
export declare type Iterator<T> = { | ||
/** | ||
* Returns `IterableResult<T>`. | ||
*/ | ||
readonly next: () => IteratorResult<T>; | ||
}; | ||
export declare type Iterable<T> = { | ||
/** | ||
* The function returns an iterator. | ||
*/ | ||
readonly [Symbol.iterator]: () => Iterator<T>; | ||
}; | ||
export declare type IterableEx<T> = Iterable<T> & { | ||
@@ -118,3 +130,3 @@ /** | ||
}; | ||
export declare const iterable: <T>(createIterator: () => Iterator<T, any, undefined>) => IterableEx<T>; | ||
export declare const iterable: <T>(createIterator: () => Iterator<T>) => IterableEx<T>; | ||
export declare type Entry<T> = readonly [number, T]; | ||
@@ -121,0 +133,0 @@ export declare const ENTRY_KEY = 0; |
{ | ||
"name": "@ts-common/iterator", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Iterator library for JavaScript and TypeScript", | ||
@@ -69,6 +69,6 @@ "main": "dist/index.js", | ||
"jest-junit": "^10.0.0", | ||
"tslib": "^2.3.1", | ||
"tslint": "^6.0.0", | ||
"tslint-immutable": "^6.0.1", | ||
"typescript": "^3.7.5", | ||
"tslib": "^1.10.0" | ||
"typescript": "^3.7.5" | ||
}, | ||
@@ -75,0 +75,0 @@ "dependencies": {}, |
@@ -0,1 +1,15 @@ | ||
export type Iterator<T> = { | ||
/** | ||
* Returns `IterableResult<T>`. | ||
*/ | ||
readonly next: () => IteratorResult<T>; | ||
} | ||
export type Iterable<T> = { | ||
/** | ||
* The function returns an iterator. | ||
*/ | ||
readonly [Symbol.iterator]: () => Iterator<T>; | ||
} | ||
export type IterableEx<T> = Iterable<T> & { | ||
@@ -2,0 +16,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56837
1.37%868
2.84%