Skip to content

Commit

Permalink
:types lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-borderless committed Jan 1, 2025
1 parent f080ba7 commit df3f242
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion functions/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Math.abs,
* Math.sqrt,
* Math.floor,
* (num) => `result: ${num}`,
* (num: number) => `result: ${num}`,
* );
* assertEquals(myPipe(-2), "result: 1");
* ```
Expand Down
2 changes: 1 addition & 1 deletion functions/pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type PipeArgs<F extends AnyFunc[], Acc extends AnyFunc[] = []> = F extends [
* Math.abs,
* Math.sqrt,
* Math.floor,
* (num) => `result: ${num}`,
* (num: number) => `result: ${num}`,
* );
* assertEquals(myPipe(-2), "result: 1");
* ```
Expand Down
8 changes: 4 additions & 4 deletions functions/pipe_test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

import { assertEquals, assertThrows } from "@std/assert";
import { pipe } from "./mod.ts";
import { pipe } from "./pipe.ts";

Deno.test("pipe() handles mixed types", () => {
const inputPipe = pipe(
Math.abs,
Math.sqrt,
Math.floor,
(num) => `result: ${num}`,
(num: number) => `result: ${num}`,
);
assertEquals(inputPipe(-2), "result: 1");
});
Expand All @@ -23,10 +23,10 @@ Deno.test("pipe() throws an exceptions when a function throws an exception", ()
Math.abs,
Math.sqrt,
Math.floor,
(num) => {
(num: number) => {
throw new Error("This is an error for " + num);
},
(num) => `result: ${num}`,
(num: number) => `result: ${num}`,
);
assertThrows(() => inputPipe(-2));
});

0 comments on commit df3f242

Please sign in to comment.