Skip to content

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

Description

@magnacartatron

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions