mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-22 19:32:54 +03:00
25 lines
534 B
JavaScript
25 lines
534 B
JavaScript
/**
|
|
* @typedef {object} RedirectEventData
|
|
* @prop {URL} url
|
|
* @prop {import('./LinkRedirect')} link
|
|
*/
|
|
|
|
module.exports = class RedirectEvent {
|
|
/**
|
|
* @param {RedirectEventData} data
|
|
* @param {Date} timestamp
|
|
*/
|
|
constructor(data, timestamp) {
|
|
this.data = data;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
/**
|
|
* @param {RedirectEventData} data
|
|
* @param {Date} [timestamp]
|
|
*/
|
|
static create(data, timestamp) {
|
|
return new RedirectEvent(data, timestamp ?? new Date);
|
|
}
|
|
};
|