fix: data serialization
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
+8
-1
@@ -114,8 +114,15 @@ export class EventObject implements EventInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toJson(): EventInterface {
|
toJson(): EventInterface {
|
||||||
|
const data = {
|
||||||
|
...this._data,
|
||||||
|
pattern: this._data.pattern instanceof EventOccurrenceObject
|
||||||
|
? this._data.pattern.toJson()
|
||||||
|
: this._data.pattern,
|
||||||
|
};
|
||||||
|
|
||||||
// Return a deep copy to avoid external modifications
|
// Return a deep copy to avoid external modifications
|
||||||
return JSON.parse(JSON.stringify(this._data));
|
return JSON.parse(JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
clone(): EventObject {
|
clone(): EventObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user