Editor node.js - Remove/Disable comment "conditional check ValidationOptions"

Editor node.js - Remove/Disable comment "conditional check ValidationOptions"

CapamaniaCapamania Posts: 236Questions: 82Answers: 5

I have a node.js application, lately I'm getting the comment "conditional check ValidationOptions" on each .validator() I'm using in the console on dev. So if I have 10 fields with .validator(), I'm getting 10 of those comments. How do I remove the comments?

new Field( 'data.title' )
      .validator( Validate.notEmpty( new Validate.Options({ message: 'Invalid. Value must be set.' }) ) ),

In the console:

conditional check ValidationOptions {
  _dependsField: null,
  _dependsValue: null,
  _dependsFn: null,
  _empty: true,
  _message: 'Invalid. Value must be set.',
  _optional: true
}

Why am I getting the "conditional check ValidationOptions" comment in my console on dev? And how to remove it?

Answers

  • CapamaniaCapamania Posts: 236Questions: 82Answers: 5

    Editor: "datatables.net-editor-server": "^2.1.2",
    Node: v22.20.0

  • CapamaniaCapamania Posts: 236Questions: 82Answers: 5

    If I out comment it in the dist/validator.js file, its gone ...

        Validator._conditional = function (val, opts, data, host) {
            //console.log('conditional check', opts);
            if (!opts) {
                // No options, so there can be no condition. Validator applies.
                return true;
            }
            // Otherwise, let the options dependency runner return the value
            return opts.runDepends(val, data, host);
        };
    
  • allanallan Posts: 65,368Questions: 1Answers: 10,846 Site admin

    My apologies - I've left a debug line in there. I've just committed a fix to remove it, and it will be in the next release.

    Allan

Sign In or Register to comment.