diff options
| author | Adam Malczewski <[email protected]> | 2026-06-27 01:09:39 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-27 01:09:39 +0900 |
| commit | 61e45e60d699ed1ca46f94a8f181c92a940317c6 (patch) | |
| tree | 2892d9773c5a8e367e1e58cdb1e88d9c6ad3fe6d /packages/tool-youtube-transcript/src/validate.ts | |
| parent | 63c7e64532e85e0bbdd6d9ac6825d8f86be98e7a (diff) | |
| parent | 727c98c9dae516a2070eb950410314380a20c974 (diff) | |
| download | dispatch-61e45e60d699ed1ca46f94a8f181c92a940317c6.tar.gz dispatch-61e45e60d699ed1ca46f94a8f181c92a940317c6.zip | |
Merge branch 'feature/indent-change' into dev
Diffstat (limited to 'packages/tool-youtube-transcript/src/validate.ts')
| -rw-r--r-- | packages/tool-youtube-transcript/src/validate.ts | 24 |
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; } |
