Skip to content

Commit

Permalink
Place submodules under src/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Nov 23, 2023
1 parent eb3e29f commit c96cf8c
Show file tree
Hide file tree
Showing 27 changed files with 50 additions and 46 deletions.
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Version 0.5.0

To be released. Unreleased versions are available on [nest.land].

- Added *range.ts* module.
- Now every submodule is inside *src/* directory. This is a breaking change
for users whom import submodules directly. For users whom import from
*mod.ts* module, this is not a breaking change.
- Added *src/range.ts* module.
- Added `range()` function.
- Added `Range` class.

Expand Down
13 changes: 1 addition & 12 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
export { fromIterable, toArray, toMap, toSet } from "./collections.ts";
export { concat } from "./concat.ts";
export { drop, dropWhile } from "./drop.ts";
export { filter } from "./filter.ts";
export { reduce } from "./fold.ts";
export { count, cycle, repeat } from "./infinite.ts";
export { map } from "./map.ts";
export { Range, range } from "./range.ts";
export { take, takeWhile } from "./take.ts";
export { tee } from "./tee.ts";
export { assertStreams, assertStreamStartsWith } from "./testing.ts";
export { groupBy, unique } from "./unique.ts";
export * from "./src/mod.ts";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export { fromIterable, toArray, toMap, toSet } from "./collections.ts";
export { concat } from "./concat.ts";
export { drop, dropWhile } from "./drop.ts";
export { filter } from "./filter.ts";
export { reduce } from "./fold.ts";
export { count, cycle, repeat } from "./infinite.ts";
export { map } from "./map.ts";
export { Range, range } from "./range.ts";
export { take, takeWhile } from "./take.ts";
export { tee } from "./tee.ts";
export { assertStreams, assertStreamStartsWith } from "./testing.ts";
export { groupBy, unique } from "./unique.ts";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/collections_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
import * as fc from "npm:[email protected]";
import { fromIterable, toArray, toMap, toSet } from "../collections.ts";
import { assertStreams } from "../testing.ts";
import { fromIterable, toArray, toMap, toSet } from "../src/collections.ts";
import { assertStreams } from "../src/testing.ts";
import { getAsyncIterable } from "./testing_test.ts";

function* toIterable<T>(...values: T[]): Iterable<T> {
Expand Down
6 changes: 3 additions & 3 deletions tests/concat_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fc from "npm:[email protected]";
import { fromIterable } from "../collections.ts";
import { concat } from "../concat.ts";
import { assertStreams } from "../testing.ts";
import { fromIterable } from "../src/collections.ts";
import { concat } from "../src/concat.ts";
import { assertStreams } from "../src/testing.ts";
import { getAsyncIterable } from "./testing_test.ts";

Deno.test("concat()", async () => {
Expand Down
10 changes: 5 additions & 5 deletions tests/drop_test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { assert } from "https://deno.land/[email protected]/assert/mod.ts";
import * as fc from "npm:[email protected]";
import { fromIterable } from "../collections.ts";
import { drop, dropWhile } from "../drop.ts";
import { count } from "../infinite.ts";
import { take } from "../take.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { fromIterable } from "../src/collections.ts";
import { drop, dropWhile } from "../src/drop.ts";
import { count } from "../src/infinite.ts";
import { take } from "../src/take.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";

Deno.test("drop()", async () => {
await assertStreamStartsWith(drop(count(0), 0), [0, 1, 2, 3, 4, 5, 6, 7, 8]);
Expand Down
6 changes: 3 additions & 3 deletions tests/filter_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { filter } from "../filter.ts";
import { count } from "../infinite.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { filter } from "../src/filter.ts";
import { count } from "../src/infinite.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";
import { getAsyncIterable } from "./testing_test.ts";

Deno.test("filter()", async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/fold_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
assertEquals,
assertRejects,
} from "https://deno.land/[email protected]/assert/mod.ts";
import { reduce } from "../fold.ts";
import { reduce } from "../src/fold.ts";
import { getAsyncIterable } from "./testing_test.ts";

Deno.test("reduce()", async () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/infinite_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertThrows } from "https://deno.land/[email protected]/assert/mod.ts";
import { count, cycle, repeat } from "../infinite.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { count, cycle, repeat } from "../src/infinite.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";

Deno.test("count()", async () => {
await assertStreamStartsWith(count(0), [0, 1, 2, 3, 4, 5]);
Expand Down
6 changes: 3 additions & 3 deletions tests/map_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertRejects } from "https://deno.land/[email protected]/assert/mod.ts";
import { count, repeat } from "../infinite.ts";
import { map } from "../map.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { count, repeat } from "../src/infinite.ts";
import { map } from "../src/map.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";

Deno.test("map()", async () => {
await assertStreams(
Expand Down
4 changes: 2 additions & 2 deletions tests/range_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
assertThrows,
} from "https://deno.land/[email protected]/assert/mod.ts";
import * as fc from "npm:[email protected]";
import { assertStreams } from "../testing.ts";
import { Range, range } from "../range.ts";
import { assertStreams } from "../src/testing.ts";
import { Range, range } from "../src/range.ts";

function validNumber(): fc.Arbitrary<number> {
return fc.oneof(
Expand Down
8 changes: 4 additions & 4 deletions tests/take_test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { assert } from "https://deno.land/[email protected]/assert/mod.ts";
import * as fc from "npm:[email protected]";
import { fromIterable } from "../collections.ts";
import { count } from "../infinite.ts";
import { take, takeWhile } from "../take.ts";
import { assertStreams } from "../testing.ts";
import { fromIterable } from "../src/collections.ts";
import { count } from "../src/infinite.ts";
import { take, takeWhile } from "../src/take.ts";
import { assertStreams } from "../src/testing.ts";

Deno.test("take()", async () => {
await assertStreams(take(count(0), 0), []);
Expand Down
6 changes: 3 additions & 3 deletions tests/tee_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fc from "npm:[email protected]";
import { fromIterable } from "../collections.ts";
import { tee } from "../tee.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { fromIterable } from "../src/collections.ts";
import { tee } from "../src/tee.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";

async function* getRandomNumbers(): AsyncIterableIterator<number> {
while (true) yield Math.random();
Expand Down
4 changes: 2 additions & 2 deletions tests/testing_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
assertRejects,
} from "https://deno.land/[email protected]/assert/mod.ts";
import * as fc from "npm:[email protected]";
import { fromIterable } from "../collections.ts";
import { assertStreams, assertStreamStartsWith } from "../testing.ts";
import { fromIterable } from "../src/collections.ts";
import { assertStreams, assertStreamStartsWith } from "../src/testing.ts";

export async function* getAsyncIterable<T>(
...args: T[]
Expand Down
6 changes: 3 additions & 3 deletions tests/unique_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
import { tee } from "../tee.ts";
import { assertStreams } from "../testing.ts";
import { groupBy, unique } from "../unique.ts";
import { tee } from "../src/tee.ts";
import { assertStreams } from "../src/testing.ts";
import { groupBy, unique } from "../src/unique.ts";
import { getAsyncIterable } from "./testing_test.ts";

Deno.test("unqiue(source)", async () => {
Expand Down

0 comments on commit c96cf8c

Please sign in to comment.