Skip to content

randFloat with equal min/max results in RangeError: Maximum call stack size exceeded #361

@soanvig

Description

@soanvig

Is this a regression?

No

Description

If I call randFloat({ min: 0, max: 0 }) I get maximum call stack size exceeded error.

  1. The same happens for other min/max values that are equal
  2. Probably other number generators might be affected as well.

This should result in 0, since 0 satisfies min and max requirements.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Note I'm using yarn PnP

RangeError: Maximum call stack size exceeded

  › l (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:442)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115474)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)
  › e (.yarn/cache/@ngneat-falso-npm-6.4.0-d3fcdd6e1d-b7711c0418.zip/node_modules/@ngneat/falso/index.cjs.js:1:115553)

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

Yes

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