ngneat/falso

randUuid returns the same id multiple times with the length parameter

slioxo opened this issue · 2 comments

Is this a regression?

No

Description

When using other methods like randProductName with the length parameter, they returns multiple different results. randUuid on the other hand will return the same UUID multiple times when the length parameter is supplied.

Please provide a link to a minimal reproduction of the bug

https://gist.github.com/slioxo/6c7a6cf1731bf095d2046a903d3556f1

Please provide the exception or error you saw

### Expected: 

I would expect `randUuid` to return an array of different UUIDs when the length parameter is supplied. When a seed is given, it should always return the same `n` UUIDs  in the same order.

### Actual

`randUuid` returns the same ID multiple times. When a seed is given, this behavior stays the same.

Please provide the environment you discovered this bug in

NodeJS with Typescript as well as plain Javascript

Anything else?

No response

Do you want to create a pull request?

No

@slioxo Can you provide an example in Stackblitz ?
I can't reproduce this issue.
Screenshot 2022-10-31 at 18 47 51

Of course, here you go: https://stackblitz.com/edit/typescript-4qpwqp?file=index.ts

EDIT: I looked at your example and see that you are using v2.27.0 of the package while I'm using v6.1.0. So it seems this functionality was broken somewhere along the way.