mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-13 06:40:33 -07:00
Rename invalidParams to validateToolParams (#12)
Methods should be verbs. Fixes #4.
This commit is contained in:
@@ -135,9 +135,10 @@ export class LSTool extends BaseTool<LSToolParams, LSToolResult> {
|
||||
* @param params Parameters to validate
|
||||
* @returns An error message string if invalid, null otherwise
|
||||
*/
|
||||
invalidParams(params: LSToolParams): string | null {
|
||||
validateToolParams(params: LSToolParams): string | null {
|
||||
if (this.schema.parameters &&
|
||||
!SchemaValidator.validate(this.schema.parameters as Record<string, unknown>, params)) {
|
||||
!SchemaValidator.validate(this.schema.parameters as Record<string, unknown>, params)
|
||||
) {
|
||||
return 'Parameters failed schema validation.';
|
||||
}
|
||||
if (!path.isAbsolute(params.path)) {
|
||||
@@ -199,7 +200,7 @@ export class LSTool extends BaseTool<LSToolParams, LSToolResult> {
|
||||
* @returns Result of the LS operation
|
||||
*/
|
||||
async execute(params: LSToolParams): Promise<LSToolResult> {
|
||||
const validationError = this.invalidParams(params);
|
||||
const validationError = this.validateToolParams(params);
|
||||
if (validationError) {
|
||||
return this.errorResult(
|
||||
params,
|
||||
|
||||
Reference in New Issue
Block a user