{"version":3,"file":"channel.mjs","names":[],"sources":["../../src/validation/channel.ts"],"sourcesContent":["import { ValidationError } from \"./validation-error\";\nimport { reasonForValue } from \"~/utils/reason-for-value\";\n\nconst channelNameRegex = /^[\\d_a-z]{1,25}$/;\n\nexport function validateChannelName(input?: string | null): void {\n  if (input == null || !channelNameRegex.test(input)) {\n    throw new ValidationError(\n      `Channel name ${reasonForValue(input)} is invalid/malformed`,\n    );\n  }\n}\n\nexport function correctChannelName(input: string): string {\n  return input.replace(/^#/, \"\");\n}\n"],"mappings":";;;AAGA,MAAM,mBAAmB;AAEzB,SAAgB,oBAAoB,OAA6B;AAC/D,KAAI,SAAS,QAAQ,CAAC,iBAAiB,KAAK,MAAM,CAChD,OAAM,IAAI,gBACR,gBAAgB,eAAe,MAAM,CAAC,uBACvC;;AAIL,SAAgB,mBAAmB,OAAuB;AACxD,QAAO,MAAM,QAAQ,MAAM,GAAG"}