mirror of
https://github.com/toss/es-toolkit.git
synced 2025-01-05 23:43:29 +03:00
docs(groupBy, keyBy): Update type of key to PropertyKey (#100)
This commit is contained in:
parent
044002ed6b
commit
6c9c0d1c26
@ -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[]>;
|
||||
```
|
||||
|
||||
### 파라미터
|
||||
|
@ -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>;
|
||||
```
|
||||
|
||||
### 파라미터
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user