Fixed path events casing issue
All checks were successful
Build / Build NPM Project (push) Successful in 46s
Build / Tag Version (push) Successful in 13s
Build / Publish Documentation (push) Successful in 52s

This commit is contained in:
2025-06-19 18:44:20 -04:00
parent e3bbd13ed8
commit 4ed23e1502
4 changed files with 38 additions and 16 deletions

View File

@ -48,7 +48,7 @@ export function PES(str: TemplateStringsArray, ...args: any[]) {
if(str[i]) combined.push(str[i]);
if(args[i]) combined.push(args[i]);
}
const [paths, methods] = combined.join('').split(':');
const [paths, methods] = combined.join('/').split(':');
return PathEvent.toString(paths, <any>methods?.split(''));
}
@ -254,8 +254,8 @@ export class PathEventEmitter implements IPathEventEmitter{
constructor(public readonly prefix: string = '') { }
emit(event: Event, ...args: any[]) {
const parsed = new PathEvent(`${this.prefix}/${new PathEvent(event).toString()}`);
this.listeners.filter(l => PathEvent.has(l[0], `${this.prefix}/${event}`))
const parsed = PE`${this.prefix}/${event}`;
this.listeners.filter(l => PathEvent.has(l[0], parsed))
.forEach(async l => l[1](parsed, ...args));
};