Skip to content

Commit

Permalink
0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Tae Woo committed Nov 11, 2019
1 parent 0bde3ca commit cb85d81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions deno/iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,25 @@ export interface IAsyncIterator_<T> extends AsyncIterableIterator<T> {
/**
* @see https://tc39.es/proposal-iterator-helpers/#sec-asynciteratorprototype-@@tostringtag
*/
[Symbol.toStringTag]: 'Async Iterator';
[Symbol.toStringTag]: string;

/**
* similar Array.prototype.every
*
* @see https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.all
*/
all(fn: PredicateFn<T>): Promise<boolean>;

/**
* similar Array.prototype.some
*
* @see https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.any
*/
any(fn: PredicateFn<T>): Promise<boolean>;

/**
* similar concat
*
* @see https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.chain
*/
chain(other: Iterable<T | Promise<T>> | AsyncIterable<T | Promise<T>>): ToAsyncIterator<T>;
Expand Down Expand Up @@ -314,7 +320,7 @@ export interface IAsyncIterator_<T> extends AsyncIterableIterator<T> {
/**
* @see https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.take
*/
take(limit: number): ToAsyncIterator<T>;
take(count: number): ToAsyncIterator<T>;

/**
* @see https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.take_while
Expand Down Expand Up @@ -580,8 +586,8 @@ export class AsyncIterator_<T> implements IAsyncIterator_<T> {
return sum(this as any);
}

public take(limit: number) {
return (new AsyncIterator_<T>(take<T>(limit, this)) as unknown) as ToAsyncIterator<T>;
public take(count_: number) {
return (new AsyncIterator_<T>(take<T>(count_, this)) as unknown) as ToAsyncIterator<T>;
}

public takeWhile(predicate: PredicateFn<T>) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syrflover/iterator",
"version": "0.2.2",
"version": "0.2.3",
"description": "Iterator Helper for TypeScript",
"main": "dist/mod.js",
"types": "dist/mod.d.ts",
Expand Down

0 comments on commit cb85d81

Please sign in to comment.