@limo-labs/deity 0.2.0 → 0.2.1
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.
- package/dist/index.cjs +2 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -510,15 +510,13 @@ function Tool(props) {
|
|
|
510
510
|
throw new Error("Tool: input schema is required");
|
|
511
511
|
}
|
|
512
512
|
let executeFn;
|
|
513
|
-
|
|
513
|
+
const hasChildren = children && Array.isArray(children) && children.length > 0;
|
|
514
|
+
if (hasChildren) {
|
|
514
515
|
if (execute) {
|
|
515
516
|
throw new Error("Tool: cannot use both children and execute prop");
|
|
516
517
|
}
|
|
517
518
|
let actualChild = children;
|
|
518
519
|
if (Array.isArray(children)) {
|
|
519
|
-
if (children.length === 0) {
|
|
520
|
-
throw new Error("Tool: children array is empty");
|
|
521
|
-
}
|
|
522
520
|
if (children.length > 1) {
|
|
523
521
|
throw new Error("Tool: can only have one child (the execute function)");
|
|
524
522
|
}
|