Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect validation with null-safe operator ? #10

Open
OKhalkov opened this issue May 10, 2023 · 0 comments
Open

Incorrect validation with null-safe operator ? #10

OKhalkov opened this issue May 10, 2023 · 0 comments

Comments

@OKhalkov
Copy link

image

Transformation rule node: Script

// Create new map
var map = {
    "temperature": 42,
    "smth": 22,
        "nonExistingKey": {
            "smth": 22
        }
};

// Null-Safe expressions using ?
if (map.?nonExistingKey.smth > 10) {
    map.smth_check = true;
} else {
    map.smth_check = false;
}

// Iterate through the map
foreach(element: map.entrySet()) {
    // str = " " +str+ " "+ element.key+" "+element.value
    // Get the key
    element.key
    // // Get the value
    element.value;
}

// get map size
map.size();

return {msg: map};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant