Skip to content

Commit

Permalink
feat: add CustomEventClass toString static method
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyeongjun committed May 3, 2024
1 parent 28e6789 commit 4bbae6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rune/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rune-ts",
"version": "0.8.7",
"version": "0.8.8",
"description": "Rune Core Library",
"engines": {
"node": ">=14.0.0"
Expand Down
12 changes: 11 additions & 1 deletion rune/src/CustomEventWithDetail.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { _camelToColonSeparated } from './lib/_camelToColonSeparated';

if (typeof global !== 'undefined') {
global.CustomEvent =
global.CustomEvent ||
Expand All @@ -10,7 +12,11 @@ if (typeof global !== 'undefined') {
};
}

export class CustomEventWithoutDetail extends CustomEvent<undefined> {}
export class CustomEventWithoutDetail extends CustomEvent<undefined> {
static override toString() {
return _camelToColonSeparated(this.name);
}
}

export class CustomEventOptionalDetail<T> extends CustomEvent<T> {}

Expand All @@ -31,4 +37,8 @@ export class CustomEventWithDetail<T> extends CustomEvent<T> {
}

private readonly isCustomEventWithDetail = true;

static override toString() {
return _camelToColonSeparated(this.name);
}
}

0 comments on commit 4bbae6a

Please sign in to comment.