mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
34 lines
568 B
JavaScript
34 lines
568 B
JavaScript
|
module.exports = class URLResourceUpdatedEvent {
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {Object}
|
||
|
*/
|
||
|
data;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {Date}
|
||
|
*/
|
||
|
timestamp;
|
||
|
|
||
|
/**
|
||
|
* @private
|
||
|
*/
|
||
|
constructor({timestamp, ...data}) {
|
||
|
this.data = data;
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @param {Object} data URL Resource
|
||
|
* @returns
|
||
|
*/
|
||
|
static create(data) {
|
||
|
return new URLResourceUpdatedEvent({
|
||
|
...data,
|
||
|
timestamp: data.timestamp || new Date
|
||
|
});
|
||
|
}
|
||
|
};
|