mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
Checks for input before processing it.
This commit is contained in:
parent
39d7dc8372
commit
015aa8c637
@ -208,8 +208,11 @@ export const OPERATIONS = [
|
|||||||
{
|
{
|
||||||
name: 'valueIs',
|
name: 'valueIs',
|
||||||
operation: function (input) {
|
operation: function (input) {
|
||||||
const values = input[1].split(',');
|
if (input[1]) {
|
||||||
return values.find((value) => input[0].toString() === _.trim(value.toString()));
|
const values = input[1].split(',');
|
||||||
|
return values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
text: 'is one of',
|
text: 'is one of',
|
||||||
appliesTo: ["string", "number"],
|
appliesTo: ["string", "number"],
|
||||||
@ -221,9 +224,12 @@ export const OPERATIONS = [
|
|||||||
{
|
{
|
||||||
name: 'valueIsNot',
|
name: 'valueIsNot',
|
||||||
operation: function (input) {
|
operation: function (input) {
|
||||||
const values = input[1].split(',');
|
if (input[1]) {
|
||||||
const found = values.find((value) => input[0].toString() === _.trim(value.toString()));
|
const values = input[1].split(',');
|
||||||
return !found;
|
const found = values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||||
|
return !found;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
text: 'is not one of',
|
text: 'is not one of',
|
||||||
appliesTo: ["string", "number"],
|
appliesTo: ["string", "number"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user