Skip to content

UUID and random dates doesn´t respect the seed #346

@MarioJuniorPro

Description

@MarioJuniorPro

Is this a regression?

Yes

Description

Generating uuids doesn´t respect the seed and it is always random. Also, when I generate dates and reload the environment, the date generated respect the seed except by the seconds.
If for some reason it is not considered a bug, would be nice to have global option to use a strict mode.

import { seed } from '@ngneat/falso';
import { randUuid, random, randSoonDate } from '@ngneat/falso';

const uuids = [];
seed('1');
uuids.push([randUuid(), random(), randSoonDate()]);
seed('2');
uuids.push([randUuid(), random(), randSoonDate()]);
seed('1');
uuids.push([randUuid(), random(), randSoonDate()]);
console.table(uuids);

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/typescript-sblpt9?file=index.ts

Please provide the exception or error you saw

// First run:
// 0	"da91cec3-7971-4a92-bb27-d54185e0be65"	0.2694488477791326	"2023-02-01T10:16:28.796Z"
// 1	"0a7b3a3e-4529-4626-b49f-7d395887312d"	0.7153687886990808	"2023-02-01T08:51:34.962Z"
// 2	"6f523c82-c565-4f84-92b9-9201899a292a"	0.2694488477791326	"2023-02-01T10:16:28.796Z"

// Seconds run:
// 0	"e5bd2a4c-d6e7-42d5-8c47-1777d8d7cefc"	0.2694488477791326	"2023-02-01T10:17:02.298Z"
// 1	"384e485c-a539-45da-b893-420e387ce038"	0.7153687886990808	"2023-02-01T08:52:08.465Z"
// 2	"ae7b7285-56d6-4efe-bb08-80ebded093f4"	0.2694488477791326	"2023-02-01T10:17:02.299Z"

Please provide the environment you discovered this bug in

It can be reproduced using this link [https://stackblitz.com/edit/typescript-sblpt9?file=index.ts]()

Anything else?

No response

Do you want to create a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions