mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +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';
|
import { Pattern, patternSchema } from '../schemas/types/pattern';
|
||||||
|
|
||||||
export function isPatternList(patterns: Pattern[]) {
|
export function isPatternList(patterns: Pattern[]) {
|
||||||
|
if (!Array.isArray(patterns)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
patterns.every((pattern) => {
|
patterns.every((pattern) => {
|
||||||
const result = patternSchema.safeParse(pattern);
|
const result = patternSchema.safeParse(pattern);
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user