mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 12:28:26 +00:00
fix: ensure the input being passed is an array
This commit is contained in:
parent
7a8545e646
commit
d4a6c26919
@ -16,6 +16,9 @@ import {
|
||||
import { Pattern, patternSchema } from '../schemas/types/pattern';
|
||||
|
||||
export function isPatternList(patterns: Pattern[]) {
|
||||
if (!Array.isArray(patterns)) {
|
||||
return false;
|
||||
}
|
||||
patterns.every((pattern) => {
|
||||
const result = patternSchema.safeParse(pattern);
|
||||
if (!result.success) {
|
||||
|
Loading…
Reference in New Issue
Block a user