From c5bdea998833d6842df88b18df5c97f07df9eddc Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 7 May 2025 21:00:49 +0700 Subject: [PATCH] Fix use of `arguments` parameter name #1122 --- source/find-global-type.d.ts | 2 +- source/set-parameter-type.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/find-global-type.d.ts b/source/find-global-type.d.ts index 05b940f9..ab2d7c8e 100644 --- a/source/find-global-type.d.ts +++ b/source/find-global-type.d.ts @@ -60,5 +60,5 @@ type FindBar = FindGlobalInstanceType<'Bar'>; // Works */ export type FindGlobalInstanceType = Name extends string - ? typeof globalThis extends Record infer T> ? T : never + ? typeof globalThis extends Record infer T> ? T : never : never; diff --git a/source/set-parameter-type.d.ts b/source/set-parameter-type.d.ts index d9bc787e..6f927406 100644 --- a/source/set-parameter-type.d.ts +++ b/source/set-parameter-type.d.ts @@ -78,7 +78,7 @@ Use-case: ``` import type {SetParameterType} from 'type-fest'; -type HandleMessage = (data: Data, message: string, ...arguments: any[]) => void; +type HandleMessage = (data: Data, message: string, ...arguments_: any[]) => void; type HandleOk = SetParameterType; //=> type HandleOk = (data: SuccessData, message: 'ok') => void; @@ -94,12 +94,12 @@ type HandleWarn = SetParameterType; // Change rest parameter type. // Way 1: Input full parameter type. -type HandleLog = SetParameterType; -//=> type HandleLog = (data: Data, message: 'log', ...arguments: string[]) => void; +type HandleLog = SetParameterType; +//=> type HandleLog = (data: Data, message: 'log', ...arguments_: string[]) => void; // Way 2: Input rest parameter type by Object index. type HandleLog2 = SetParameterType; -//=> type HandleLog2 = (data: Data, message: string, ...arguments: string[]) => void; +//=> type HandleLog2 = (data: Data, message: string, ...arguments_: string[]) => void; ``` @category Function