Unsafe return type of `sample`-function
The return-type of the `sample`-function is incorrect for the edge case of an empty collection.
```ts
import { sample } from "es-toolkit/array"
function foo(input: string[]){
return sample(input)
}
const result: string = foo([]) // => undefined
```
关闭于 2026-03-02 1 条评论