Skip to content

Commit

Permalink
refactor: declare fields, remove from constructor, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 7, 2022
1 parent 0e82819 commit 364ef2c
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/events/schedule/ScheduleEvent.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import { createUniqueId } from '../../utils/index.js'

export default class ScheduleEvent {
constructor(region) {
// format of aws displaying the time, e.g.: 2020-02-09T14:13:57Z
const time = new Date().toISOString().replace(/\.(.*)(?=Z)/g, '')
account = createUniqueId()

detail = {};

['detail-type'] = 'Scheduled Event'

id = createUniqueId()

region = null

this.account = createUniqueId()
this.detail = {}
this['detail-type'] = 'Scheduled Event'
this.id = createUniqueId()
resources = []

source = 'aws.events'

// format of aws displaying the time, e.g.: 2020-02-09T14:13:57Z
time = new Date().toISOString().replace(/\.(.*)(?=Z)/g, '')

version = '0'

constructor(region) {
this.region = region
this.resources = []
this.source = 'aws.events'
this.time = time
this.version = '0'
}
}

0 comments on commit 364ef2c

Please sign in to comment.