path event fixes
Some checks failed
Build / Build NPM Project (push) Failing after 45s
Build / Publish Documentation (push) Has been skipped
Build / Tag Version (push) Has been skipped

This commit is contained in:
Zakary Timson 2025-06-24 20:52:16 -04:00
parent 8c1fb2d8cb
commit 8f7e816571
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ztimson/utils",
"version": "0.25.15",
"version": "0.25.16",
"description": "Utility library",
"author": "Zak Timson",
"license": "MIT",

View File

@ -99,7 +99,7 @@ export class PathEvent {
method = '*';
}
let temp = p.split('/').filter(p => !!p);
this.module = temp.splice(0, 1)[0]?.toLowerCase() || '';
this.module = temp.splice(0, 1)[0] || '';
this.path = temp.join('/');
this.fullPath = `${this.module}${this.module && this.path ? '/' : ''}${this.path}`;
this.name = temp.pop() || '';
@ -265,7 +265,7 @@ export class PathEventEmitter implements IPathEventEmitter{
on(event: Event | Event[], listener: PathListener): PathUnsubscribe {
makeArray(event).forEach(e => this.listeners.push([
new PathEvent(`${this.prefix}/${new PathEvent(e).toString()}`),
new PathEvent(`${this.prefix}/${e}`),
listener
]));
return () => this.off(listener);