## countBy() function  
Counts iterable elements by a key function, returning a sparse map of key to count. Matches Lodash `countBy` semantics (no zero-fill for missing keys).

**Signature:**
```typescript
export declare function countBy<T, K extends keyof any>(items: Iterable<T>, keyFn: (value: T) => K): Partial<Record<K, number>>;
```

## Parameters  
| Parameter | Type                 | Description                           |
|-----------|----------------------|---------------------------------------|
| items     | Iterable<T>          | The items to count.                  |
| keyFn     | (value: T) => K      | The function to extract the key from each item. |

**Returns:**  
Partial<Record<K, number>>  
A map of key to count for keys that appear at least once.

- [countBy() function](/content/docs/sdk/core.countby#countby-function/index.html)
- [Parameters](/content/docs/sdk/core.countby#parameters/index.html)
