first commit
This commit is contained in:
23
node_modules/n8n-workflow/dist/esm/cron.js
generated
vendored
Normal file
23
node_modules/n8n-workflow/dist/esm/cron.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { randomInt } from './utils';
|
||||
export const toCronExpression = (item) => {
|
||||
const randomSecond = randomInt(60);
|
||||
if (item.mode === 'everyMinute')
|
||||
return `${randomSecond} * * * * *`;
|
||||
if (item.mode === 'everyHour')
|
||||
return `${randomSecond} ${item.minute} * * * *`;
|
||||
if (item.mode === 'everyX') {
|
||||
if (item.unit === 'minutes')
|
||||
return `${randomSecond} */${item.value} * * * *`;
|
||||
const randomMinute = randomInt(60);
|
||||
if (item.unit === 'hours')
|
||||
return `${randomSecond} ${randomMinute} */${item.value} * * *`;
|
||||
}
|
||||
if (item.mode === 'everyDay')
|
||||
return `${randomSecond} ${item.minute} ${item.hour} * * *`;
|
||||
if (item.mode === 'everyWeek')
|
||||
return `${randomSecond} ${item.minute} ${item.hour} * * ${item.weekday}`;
|
||||
if (item.mode === 'everyMonth')
|
||||
return `${randomSecond} ${item.minute} ${item.hour} ${item.dayOfMonth} * *`;
|
||||
return item.cronExpression.trim();
|
||||
};
|
||||
//# sourceMappingURL=cron.js.map
|
||||
Reference in New Issue
Block a user