Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect definition for NumberOrBoolean check in resources/buildConfigDefinition.js #9643

Open
magnacartatron opened this issue Mar 13, 2025 · 2 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@magnacartatron
Copy link

New Issue Checklist

Issue Description

Error in code base.
ParseServerOption cluster param uses NumberOrBoolean for check

/* Run with cluster, optionally set the number of processes default to os.cpus().length */
  cluster: ?NumberOrBoolean;

In resources/buildConfigDefinition.js NumberOrBoolean assigns the function numberOrBooleanParser

if (type == 'NumberOrBoolean') {
      return wrap(t.identifier('numberOrBooleanParser'));
    }

This function does not exist in src/Options/parsers.js
The correct function is numberOrBoolParser

function numberOrBoolParser(key) {
  return function (opt) {
    if (typeof opt === 'boolean') {
      return opt;
    }
    if (opt === 'true') {
      return true;
    }
    if (opt === 'false') {
      return false;
    }
    return numberParser(key)(opt);
  };
}

Environment

ubuntu 24.04

Server

  • Parse Server version: 8.0.1-alpha.1
  • Operating system: ubuntu 24.04
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local
Copy link

🚀 Thanks for opening this issue!

ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Mar 17, 2025
@mtrezza
Copy link
Member

mtrezza commented Mar 17, 2025

Would you want to open a PR for this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants