docs(groupBy, keyBy): Update type of key to PropertyKey (#100)

This commit is contained in:
Dongho Kim 2024-06-30 15:49:13 +09:00 committed by GitHub
parent 044002ed6b
commit 6c9c0d1c26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
## 인터페이스
```typescript
function groupBy<T, K extends string>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
function groupBy<T, K extends PropertyKey>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
```
### 파라미터

View File

@ -9,7 +9,7 @@
## 인터페이스
```typescript
function keyBy<T, K extends string>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>;
function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>;
```
### 파라미터

View File

@ -9,7 +9,7 @@ the same key.
## Signature
```typescript
function groupBy<T, K extends string>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
function groupBy<T, K extends PropertyKey>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]>;
```
### Parameters

View File

@ -9,7 +9,7 @@ If there are multiple elements generating the same key, the last element among t
## Signature
```typescript
function keyBy<T, K extends string>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>;
function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T>;
```
### Parameters