function updateNodeCredentials(node, credDefinition, prefix) {
        const changes = {};

        if (!node.credentials) {
            node.credentials = {_:{}};
        } else if (!node.credentials._) {
            node.credentials._ = {};
        }

        for (var cred in credDefinition) {
            if (credDefinition.hasOwnProperty(cred)) {
                var input = $("#" + prefix + '-' + cred);
                if (input.length > 0) {
                    var value = input.val();
                    if (credDefinition[cred].type == 'password') {
                        if (value === '__PWRD__') {
                            // A cred value exists - no changes
                        } else if (value === '' && node.credentials['has_' + cred] === false) {
                            // Empty cred value exists - no changes
                        } else if (value === node.credentials[cred]) {
                            // A cred value exists locally in the editor - no changes
                            // Like the user sets a value, saves the config,
                            // reopens the config and save the config again
                        } else {
                            changes['has_' + cred] = node.credentials['has_' + cred];
                            changes[cred] = node.credentials[cred];
                            node.credentials[cred] = value;
                        }

                        node.credentials['has_' + cred] = (value !== '');
                    } else {
                        // Since these creds are loaded by the editor,
                        // values can be directly compared
                        if (value !== node.credentials[cred]) {
                            changes[cred] = node.credentials[cred];
                            node.credentials[cred] = value;
                        }
                    }
                }
            }
        }

        return changes;
    }
Update the node credentials from the edit form
@param node - the node containing the credentials
@param credDefinition - definition of the credentials
@param prefix - prefix of the input fields
@return {object} an object containing the modified properties