diff --git a/discojs/src/client/types.ts b/discojs/src/client/types.ts index a73dc4a75..18fd21a35 100644 --- a/discojs/src/client/types.ts +++ b/discojs/src/client/types.ts @@ -1,6 +1,5 @@ export type NodeID = string -// TODO @s314cy: regexp test just like server-side export function isNodeID (raw: unknown): raw is NodeID { - return typeof raw === 'string' + return typeof raw === 'string' && /^[a-zA-Z0-9_-]{1,64}$/.test(raw) }