export const RESERVED_KEYWORDS = new Set([ "abstract", "arguments", "async", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "eval", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "using", "var", "void", "volatile", "while", "with", "yield", ]); export class ApiValidationError extends Error { constructor(message: string) { super(`[Sonamu API Validation] ${message}`); this.name = "ApiValidationError"; } } export function validateMethodName(methodName: string) { if (RESERVED_KEYWORDS.has(methodName)) { throw new ApiValidationError( `Method name ${methodName} is a reserved keyword. Please choose a different name.`, ); } }