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; } 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; }