Add function docs

This commit is contained in:
GogoVega 2024-10-27 13:24:43 +01:00
parent 1fd4fbc299
commit 5e9195ab99
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -1473,7 +1473,14 @@ RED.nodes = (function() {
} }
/** /**
* Converts the current node selection to an exportable JSON Object * Converts the current node selection to an exportable JSON Object
**/ * @param {Array<Node>} set the node selection to export
* @param {Object} options
* @param {Record<string, boolean>} [options.exportedIds]
* @param {Record<string, boolean>} [options.exportedSubflows]
* @param {Record<string, boolean>} [options.exportedConfigNodes]
* @param {boolean} [options.includeModuleConfig]
* @returns {Array<Node>}
*/
function createExportableNodeSet(set, { function createExportableNodeSet(set, {
exportedIds, exportedIds,
exportedSubflows, exportedSubflows,
@ -1561,9 +1568,13 @@ RED.nodes = (function() {
return nns; return nns;
} }
// Create the Flow JSON for the current configuration /**
// opts.credentials (whether to include (known) credentials) - default: true * Converts the current configuration to an exportable JSON Object
// opts.dimensions (whether to include node dimensions) - default: false * @param {object} opts
* @param {boolean} [opts.credentials] whether to include (known) credentials. Default `false`.
* @param {boolean} [opts.dimensions] whether to include node dimensions. Default `false`.
* @returns {Array<Node>}
*/
function createCompleteNodeSet(opts) { function createCompleteNodeSet(opts) {
var nns = []; var nns = [];
var i; var i;
@ -2990,6 +3001,12 @@ RED.nodes = (function() {
} }
} }
} }
/**
* Gets the module list for the given nodes
* @param {Array<Node>} nodes the nodes to search in
* @returns {Record<string, string>} an object with {[moduleName]: moduleVersion}
*/
function getModuleListForNodes(nodes) { function getModuleListForNodes(nodes) {
const modules = {} const modules = {}
nodes.forEach(n => { nodes.forEach(n => {