Skip to content

Commit

Permalink
style: typo and formatting (#13)
Browse files Browse the repository at this point in the history
* style(README): code formatting

* style: typo
  • Loading branch information
scarf005 authored Jul 23, 2023
1 parent 94d9b40 commit 89e61d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ import * as iter from "https://deno.land/x/iter/fp.ts";
import { c, p } from "https://deno.land/x/copb/mod.ts";

const pipeline = c(
p(iter.map<number>((x) => x * 100))(
// Only needed type annotation, the rest is inferred.
iter.map(Math.floor)
)(iter.filter((x) => x % 3 === 0))(iter.take(30))(
iter.reduce((str, x) => str + x, "")
)(console.log)
p (iter.map<number>(x => x * 100)) // Only needed type annotation, the rest is inferred.
(iter.map(Math.floor))
(iter.filter(x => x % 3 === 0))
(iter.take(30))
(iter.reduce((str, x) => str + x, ""))
(console.log)
);

pipeline(iter.create.randomNumbers());
Expand Down
2 changes: 1 addition & 1 deletion lib/combiners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function pair<T, U>(
// TODO: Map function

/**
* Combines two or more iterab;es.
* Combines two or more iterables.
* @param head - The first iterable.
* @param tails - (blob) Additional iterables to add to the end of head. If
* there are more than one, they must be of the same type.
Expand Down
4 changes: 2 additions & 2 deletions lib/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ export function take<T>(it: Iterable<T>, n: number): IterableCircular<T> {

/**
* Returns a new iterable which yields until `f` returns true.
* true.
*
* @param it - The iterable being cut.
* @param {IterablePredicateCallback} f - A function that accepts up to three
* arguments. The cut function calls `f` one time for each item in the iterable.
* arguments. The `until` function calls `f` one time for each item in the iterable.
* @param includeLast - Whether the item for which `f` returns true should be
* included.
* @typeParam T - The type of items in both `it` and the returned iterable.
Expand Down
2 changes: 1 addition & 1 deletion lib/transformers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Deno.test("filter", () => {
}
});

Deno.test("cut", () => {
Deno.test("until", () => {
const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
const cutNumbers = [...transformers.until(numbers, (n) => n === 5)];
const cutNumbersExclusive = [
Expand Down

0 comments on commit 89e61d1

Please sign in to comment.