@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.js
CHANGED
|
@@ -488,15 +488,13 @@ function Tool(props) {
|
|
|
488
488
|
throw new Error("Tool: input schema is required");
|
|
489
489
|
}
|
|
490
490
|
let executeFn;
|
|
491
|
-
|
|
491
|
+
const hasChildren = children && Array.isArray(children) && children.length > 0;
|
|
492
|
+
if (hasChildren) {
|
|
492
493
|
if (execute) {
|
|
493
494
|
throw new Error("Tool: cannot use both children and execute prop");
|
|
494
495
|
}
|
|
495
496
|
let actualChild = children;
|
|
496
497
|
if (Array.isArray(children)) {
|
|
497
|
-
if (children.length === 0) {
|
|
498
|
-
throw new Error("Tool: children array is empty");
|
|
499
|
-
}
|
|
500
498
|
if (children.length > 1) {
|
|
501
499
|
throw new Error("Tool: can only have one child (the execute function)");
|
|
502
500
|
}
|