mirror of
https://github.com/toss/es-toolkit.git
synced 2025-01-08 17:31:36 +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
|
```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
|
```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
|
## Signature
|
||||||
|
|
||||||
```typescript
|
```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
|
### Parameters
|
||||||
|
@ -9,7 +9,7 @@ If there are multiple elements generating the same key, the last element among t
|
|||||||
## Signature
|
## Signature
|
||||||
|
|
||||||
```typescript
|
```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
|
### Parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user