export interface CommandDetails { name : string ; arguments ? : string ; } export class Command { private matcher : RegExp = /^\/([\w]+)\b *(.*)?$/m ; constructor ( readonly name ) { } public checkComment ( comment = "" ) { const command = comment . match ( this . matcher ) ; if ( command && this . name === command [ 1 ] ) { return { name : this . name , arguments : command [ 2 ] , } ; } } }