Files
speckle-server/packages/server/modules/automate/utils/automationConfigurationValidator.ts
T
2024-05-28 13:20:10 +01:00

11 lines
385 B
TypeScript

import { AutomationCreationError } from '@/modules/automate/errors/management'
export const validateAutomationName = (automationName: string): void => {
const nameLength = automationName?.length || 0
if (nameLength < 1 || nameLength > 255) {
throw new AutomationCreationError(
'Automation name should be a string between the length of 1 and 255 characters.'
)
}
}