MCPcopy Index your code
hub / github.com/bugy/script-server / removeEmptyValues

Function removeEmptyValues

web-src/src/admin/store/script-config-module.js:9–28  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

7const allowedEmptyValuesInParam = ['name'];
8
9function removeEmptyValues(config) {
10 if (isEmptyArray(config.parameters)) {
11 return;
12 }
13
14 for (const parameter of config.parameters) {
15 let emptyValueKeys = [];
16 forEachKeyValue(parameter, (key, value) => {
17 if (contains(allowedEmptyValuesInParam, key)) {
18 return;
19 }
20
21 if (isEmptyValue(value)) {
22 emptyValueKeys.push(key);
23 }
24 });
25
26 emptyValueKeys.forEach(key => delete parameter[key]);
27 }
28}
29
30export const NEW_SCRIPT = '_new';
31

Callers 1

prepareConfigForSaveFunction · 0.85

Calls 5

isEmptyArrayFunction · 0.90
forEachKeyValueFunction · 0.90
containsFunction · 0.90
isEmptyValueFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected