@xano/developer-mcp 1.0.39 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -88,6 +88,40 @@ conditional {
|
|
|
88
88
|
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
+
### Early Return
|
|
92
|
+
|
|
93
|
+
Stop execution and return a value immediately. Useful for guard clauses and skipping unnecessary work.
|
|
94
|
+
|
|
95
|
+
```xs
|
|
96
|
+
// Guard clause - return early if condition is met
|
|
97
|
+
conditional {
|
|
98
|
+
if ($input.skip) {
|
|
99
|
+
return { value = null }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Return early with a value
|
|
104
|
+
conditional {
|
|
105
|
+
if ($input.use_cache && $cached_result != null) {
|
|
106
|
+
return { value = $cached_result }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Short-circuit with a successful response
|
|
111
|
+
db.get "order" {
|
|
112
|
+
field_name = "id"
|
|
113
|
+
field_value = $input.order_id
|
|
114
|
+
} as $order
|
|
115
|
+
|
|
116
|
+
conditional {
|
|
117
|
+
if ($order.status == "completed") {
|
|
118
|
+
return { value = $order }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Continue with expensive processing for non-completed orders...
|
|
123
|
+
```
|
|
124
|
+
|
|
91
125
|
### API Request with Error Handling
|
|
92
126
|
```xs
|
|
93
127
|
api.request {
|
package/package.json
CHANGED