From df3f24248e8b55e0b5a5ec1d12b984035a416209 Mon Sep 17 00:00:00 2001 From: Guy Kedem Date: Wed, 1 Jan 2025 14:19:04 +0700 Subject: [PATCH] :types lint fix --- functions/mod.ts | 2 +- functions/pipe.ts | 2 +- functions/pipe_test.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/mod.ts b/functions/mod.ts index 51d58b77123e..25e57da63b69 100644 --- a/functions/mod.ts +++ b/functions/mod.ts @@ -9,7 +9,7 @@ * Math.abs, * Math.sqrt, * Math.floor, - * (num) => `result: ${num}`, + * (num: number) => `result: ${num}`, * ); * assertEquals(myPipe(-2), "result: 1"); * ``` diff --git a/functions/pipe.ts b/functions/pipe.ts index f64f8358c474..bce742580e03 100644 --- a/functions/pipe.ts +++ b/functions/pipe.ts @@ -28,7 +28,7 @@ type PipeArgs = F extends [ * Math.abs, * Math.sqrt, * Math.floor, - * (num) => `result: ${num}`, + * (num: number) => `result: ${num}`, * ); * assertEquals(myPipe(-2), "result: 1"); * ``` diff --git a/functions/pipe_test.ts b/functions/pipe_test.ts index 7632928fc8ab..501d11a9db7d 100644 --- a/functions/pipe_test.ts +++ b/functions/pipe_test.ts @@ -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"); }); @@ -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)); });