mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
remove unnecessary isArray check
This commit is contained in:
@@ -247,16 +247,6 @@ describe('providerUtils', () => {
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('should handle non-array parameters', () => {
|
||||
const parameters = {} as unknown as RecipeParameter[]; // Invalid type
|
||||
const recipeContent = {
|
||||
prompt: 'Use {{some_param}}',
|
||||
};
|
||||
|
||||
const result = filterValidUsedParameters(parameters, recipeContent);
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('should handle empty recipe content', () => {
|
||||
const parameters = [createParameter('param1'), createParameter('param2')];
|
||||
const recipeContent = {};
|
||||
|
||||
@@ -82,7 +82,7 @@ export const filterValidUsedParameters = (
|
||||
parameters: RecipeParameter[] | undefined,
|
||||
recipeContent: { prompt?: string; instructions?: string; activities?: string[] }
|
||||
): RecipeParameter[] => {
|
||||
if (!parameters || !Array.isArray(parameters)) {
|
||||
if (!parameters) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user