summaryrefslogtreecommitdiffhomepage
path: root/packages/tool-youtube-transcript/src/validate.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-27 01:12:40 +0900
committerAdam Malczewski <[email protected]>2026-06-27 01:12:40 +0900
commit98b0638838a8e754927d8c030ce8bded18d63e7d (patch)
tree0d4e21c3d4792fcd77e1040373b260e38efa34ce /packages/tool-youtube-transcript/src/validate.ts
parentd92a4af6191d7d20acf861adf605ad0227b6b287 (diff)
parent61e45e60d699ed1ca46f94a8f181c92a940317c6 (diff)
downloaddispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.tar.gz
dispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.zip
Merge branch 'dev' into feature/heartbeat
# Conflicts: # packages/host-bin/package.json # packages/host-bin/src/main.ts # packages/session-orchestrator/src/orchestrator.ts # packages/system-prompt/src/service.test.ts # packages/system-prompt/src/service.ts # packages/system-prompt/src/types.ts # packages/transport-contract/package.json # packages/transport-http/package.json # packages/transport-http/src/app.test.ts # packages/transport-http/src/app.ts # packages/transport-http/src/extension.ts # packages/transport-http/tsconfig.json # tsconfig.json
Diffstat (limited to 'packages/tool-youtube-transcript/src/validate.ts')
-rw-r--r--packages/tool-youtube-transcript/src/validate.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/tool-youtube-transcript/src/validate.ts b/packages/tool-youtube-transcript/src/validate.ts
index 3a9d919..040dc55 100644
--- a/packages/tool-youtube-transcript/src/validate.ts
+++ b/packages/tool-youtube-transcript/src/validate.ts
@@ -15,16 +15,16 @@ export type ValidationError = { readonly error: string };
* input — the tool surfaces the message verbatim.
*/
export function validateUrl(args: unknown): string | ValidationError {
- if (args === null || args === undefined || typeof args !== "object") {
- return { error: "Error: Arguments must be an object with a 'url' string." };
- }
- const obj = args as Record<string, unknown>;
- const raw = obj.url;
- if (typeof raw !== "string") {
- return { error: "Error: 'url' is required and must be a string." };
- }
- if (raw.trim().length === 0) {
- return { error: "Error: 'url' must not be empty." };
- }
- return raw;
+ if (args === null || args === undefined || typeof args !== "object") {
+ return { error: "Error: Arguments must be an object with a 'url' string." };
+ }
+ const obj = args as Record<string, unknown>;
+ const raw = obj.url;
+ if (typeof raw !== "string") {
+ return { error: "Error: 'url' is required and must be a string." };
+ }
+ if (raw.trim().length === 0) {
+ return { error: "Error: 'url' must not be empty." };
+ }
+ return raw;
}