UNPKG

undo-pie

Version:

![npm](https://img.shields.io/npm/v/undo-recovery?color=green) ![license](https://img.shields.io/npm/l/undo-recovery) ![downloads](https://img.shields.io/npm/dt/undo-recovery)

21 lines (18 loc) 693 B
const MessageUndo = require('./messageUndo'); const FileUndo = require('./fileUndo'); const ImageUndo = require('./imageUndo'); class Undo { constructor(options = {}) { this.messageUndo = new MessageUndo(options); this.fileUndo = new FileUndo(options); this.imageUndo = new ImageUndo(options); this.retentionPeriod = options.retentionPeriod || 24 * 60 * 60 * 1000; // Default 24 hours } async cleanup() { const now = Date.now(); await this.messageUndo.cleanup(now - this.retentionPeriod); await this.fileUndo.cleanup(now - this.retentionPeriod); await this.imageUndo.cleanup(now - this.retentionPeriod); } } module.exports = Undo;