From f8ad2b0e824b9afdafe7fc1c3804711355628d8a Mon Sep 17 00:00:00 2001 From: ramong26 Date: Wed, 18 Feb 2026 10:47:05 +0900 Subject: [PATCH 1/2] fix(setToEntries): handle Set iterator type correctly --- src/compat/_internal/setToEntries.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compat/_internal/setToEntries.ts b/src/compat/_internal/setToEntries.ts index 304d4ba00..6373f9968 100644 --- a/src/compat/_internal/setToEntries.ts +++ b/src/compat/_internal/setToEntries.ts @@ -1,10 +1,11 @@ -export function setToEntries(set: Set) { - const arr = new Array(set.size); +export function setToEntries(set: Set): [T, T][] { + const arr = new Array<[T, T]>(set.size); const values = set.values(); for (let i = 0; i < arr.length; i++) { - const value = values.next().value; + const value = values.next().value as T; arr[i] = [value, value]; } + return arr; } From 3115ad99ddc9ae7cdbefb79c2d4030bf2687a223 Mon Sep 17 00:00:00 2001 From: ramong26 Date: Wed, 18 Feb 2026 11:21:48 +0900 Subject: [PATCH 2/2] fix(toKey): replace any with unknown --- src/compat/_internal/toKey.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compat/_internal/toKey.ts b/src/compat/_internal/toKey.ts index 55ac4b578..21949bfbd 100644 --- a/src/compat/_internal/toKey.ts +++ b/src/compat/_internal/toKey.ts @@ -2,10 +2,10 @@ * Converts `value` to a string key if it's not a string or symbol. * * @private - * @param {*} value The value to inspect. + * @param {unknown} value The value to inspect. * @returns {string|symbol} Returns the key. */ -export function toKey(value: any) { +export function toKey(value: unknown): string | symbol { if (typeof value === 'string' || typeof value === 'symbol') { return value; }