Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/amplify-category-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"graphql-transformer-core": "^8.2.18",
"inquirer": "^7.3.3",
"inquirer-datepicker": "^2.0.0",
"jstreemap": "^1.28.2",
"lodash": "^4.17.21",
"promise-sequential": "^1.1.1",
"uuid": "^8.3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
AWS Cron Expression generator
*/

import { TreeSet } from 'jstreemap';
const SECOND = 0;
const MINUTE = 1;
const HOUR = 2;
Expand Down Expand Up @@ -38,13 +37,13 @@ dayMap.set('SAT', 7);

export class CronExpression {
private cronExpression: string = null;
seconds = new TreeSet();
minutes = new TreeSet();
hours = new TreeSet();
daysOfMonth = new TreeSet();
months = new TreeSet();
daysOfWeek = new TreeSet();
years = new TreeSet();
seconds = new Set<number>();
minutes = new Set<number>();
hours = new Set<number>();
daysOfMonth = new Set<number>();
months = new Set<number>();
daysOfWeek = new Set<number>();
years = new Set<number>();
lastDayOfWeek = false;
numDayOfWeek = 0;
lastDayOfMonth = false;
Expand Down Expand Up @@ -99,25 +98,25 @@ export class CronExpression {
this.expressionParsed = true;
try {
if (this.seconds === null) {
this.seconds = new TreeSet();
this.seconds = new Set<number>();
}
if (this.minutes === null) {
this.minutes = new TreeSet();
this.minutes = new Set<number>();
}
if (this.hours === null) {
this.hours = new TreeSet();
this.hours = new Set<number>();
}
if (this.daysOfMonth === null) {
this.daysOfMonth = new TreeSet();
this.daysOfMonth = new Set<number>();
}
if (this.months === null) {
this.months = new TreeSet();
this.months = new Set<number>();
}
if (this.daysOfWeek === null) {
this.daysOfWeek = new TreeSet();
this.daysOfWeek = new Set<number>();
}
if (this.years === null) {
this.years = new TreeSet();
this.years = new Set<number>();
}

let exprOn = SECOND;
Expand Down Expand Up @@ -148,9 +147,9 @@ export class CronExpression {
if (exprOn <= YEAR) {
this.storeExpressionValues(0, '*', YEAR);
}
const dow: TreeSet<number> = this.getSet(DAY_OF_WEEK);
const dow: Set<number> = this.getSet(DAY_OF_WEEK);

const dom: TreeSet<number> = this.getSet(DAY_OF_MONTH);
const dom: Set<number> = this.getSet(DAY_OF_MONTH);

// Copying the logic from the UnsupportedOperationException below
const dayOfMSpec = !dom.has(NO_SPEC_INT);
Expand Down Expand Up @@ -246,7 +245,7 @@ export class CronExpression {
throw new Error("'?' can only be specified for Day-of-Month or Day-of-Week." + String(i));
}
if (type === DAY_OF_WEEK && !this.lastDayOfMonth) {
const val: number = this.daysOfMonth.last();
const val: number = Math.max(...this.daysOfMonth);
if (val === NO_SPEC_INT) {
throw new Error("'?' can only be specified for Day-of-Month -OR- Day-of-Week." + String(i));
}
Expand Down Expand Up @@ -629,13 +628,13 @@ export class CronExpression {
// reset internal state
this.expressionParsed = false;

this.seconds = new TreeSet();
this.minutes = new TreeSet();
this.hours = new TreeSet();
this.daysOfMonth = new TreeSet();
this.months = new TreeSet();
this.daysOfWeek = new TreeSet();
this.years = new TreeSet();
this.seconds = new Set<number>();
this.minutes = new Set<number>();
this.hours = new Set<number>();
this.daysOfMonth = new Set<number>();
this.months = new Set<number>();
this.daysOfWeek = new Set<number>();
this.years = new Set<number>();

this.lastDayOfWeek = false;
this.numDayOfWeek = 0;
Expand Down
8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ __metadata:
inquirer: ^7.3.3
inquirer-datepicker: ^2.0.0
jest: ^29.7.0
jstreemap: ^1.28.2
lodash: ^4.17.21
promise-sequential: ^1.1.1
uuid: ^8.3.2
Expand Down Expand Up @@ -26090,13 +26089,6 @@ __metadata:
languageName: node
linkType: hard

"jstreemap@npm:^1.28.2":
version: 1.28.2
resolution: "jstreemap@npm:1.28.2"
checksum: d7f55ff23c3bc1f54a7b92675fd785ab4f069052b25137b2d1d47a10722dd8f8442d1a710d0d3144322412e654e3f3f71f4326f7126d7287497d4cdbd94c9f80
languageName: node
linkType: hard

"jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.2.1":
version: 3.2.1
resolution: "jsx-ast-utils@npm:3.2.1"
Expand Down
Loading