Skip to content

Commit

Permalink
add entries
Browse files Browse the repository at this point in the history
  • Loading branch information
duart38 committed Mar 16, 2021
1 parent db800b6 commit 30f0ebf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builder/ARRAY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export class ARR<I> implements WritableBuilder<Array<I>, ARR<I>>, Logical {
return this;
}

public entries(): IterableIterator<[number, I]>{
return this.value.entries();
}

/**
* join the array together into a string
* @param separator
Expand Down
5 changes: 5 additions & 0 deletions tests/ARRAY_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,8 @@ Deno.test("Test array chaining", () => {
});
if (!called) fail("incorrect clause");
});

Deno.test("Test array entries", () => {
// merely runs the internal entries. no need for testing
ARRAY(["hello"]).entries();
});

0 comments on commit 30f0ebf

Please sign in to comment.