Add function docs

pull/5123/head
GogoVega 2024-10-27 13:24:43 +01:00
parent a113392b50
commit cad93b3650
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B
1 changed files with 22 additions and 5 deletions

View File

@ -1494,7 +1494,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,
@ -1582,10 +1589,14 @@ 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
// opts.includeModuleConfig (whether to include modules) - default: false * @param {boolean} [opts.credentials] whether to include (known) credentials. Default `true`.
* @param {boolean} [opts.dimensions] whether to include node dimensions. Default `false`.
* @param {boolean} [opts.includeModuleConfig] whether to include modules. Default `false`.
* @returns {Array<object>}
*/
function createCompleteNodeSet(opts) { function createCompleteNodeSet(opts) {
var nns = []; var nns = [];
var i; var i;
@ -3164,6 +3175,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 => {