Search code examples
javascriptnode.jswebstorm

Binary operation argument type string is not compatible with type string


My editor (Webstorm) is giving me this weird message:

Binary operation argument type string is not compatible with type string

Here is the code that is causing the warning message:

const {masterid = '', type = ''} = req.query;

if (!masterid) {
    return res.status(500).send(new Error('Missing query param "masterid".'));
}

async.autoInject({

    patients(callback) {
        if(type && type !== 'staff'){
            return process.nextTick(callback);
        }
        store.get(`chat:presence:users:${masterid}`, callback)
    },

    users(callback) {
        if(type && type !== 'patient'){
            return process.nextTick(callback);
        }
        store.get(`chat:presence:patient:${masterid}`, callback);
    }

}, (err, results) => {

    if (err) {
        return res.status(err.code).send(err);
    }

    res.json(results);

});

maybe I am using the wrong syntax?

enter image description here

I am just trying to set default values for the variables..the syntax should be correct.


Solution

  • It's a bug, please follow WEB-33226 for updates