@digipair/skill-cron 0.21.12 → 0.21.13

Sign up to get free protection for your applications and to get access to all the features.
package/index.cjs.js CHANGED
@@ -9959,7 +9959,7 @@ let CronService = class CronService {
9959
9959
  }
9960
9960
  async start(path) {
9961
9961
  const content = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
9962
- const lines = content.split('\n');
9962
+ const lines = content.split('\n').filter((line)=>line !== '');
9963
9963
  const planning = lines.map((line)=>JSON.parse(line));
9964
9964
  for (const plan of planning){
9965
9965
  const job = new dist.CronJob(plan.time, async ()=>{
@@ -10004,7 +10004,7 @@ let CronService = class CronService {
10004
10004
  var _context_privates_EDITOR_PATH;
10005
10005
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
10006
10006
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10007
- const lines = text.split('\n');
10007
+ const lines = text.split('\n').filter((line)=>line !== '');
10008
10008
  const crons = lines.map((line)=>JSON.parse(line));
10009
10009
  return crons;
10010
10010
  }
@@ -10028,7 +10028,7 @@ let CronService = class CronService {
10028
10028
  var _context_privates_EDITOR_PATH;
10029
10029
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10030
10030
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10031
- const lines = text.split('\n');
10031
+ const lines = text.split('\n').filter((line)=>line !== '');
10032
10032
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10033
10033
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10034
10034
  this.deleteJob(id);
@@ -10042,7 +10042,7 @@ let CronService = class CronService {
10042
10042
  var _context_privates_EDITOR_PATH;
10043
10043
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10044
10044
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10045
- const lines = text.split('\n');
10045
+ const lines = text.split('\n').filter((line)=>line !== '');
10046
10046
  const crons = lines.map((line)=>JSON.parse(line));
10047
10047
  const cron = crons.find((cron)=>cron.id === id);
10048
10048
  cron.enabled = true;
@@ -10056,7 +10056,7 @@ let CronService = class CronService {
10056
10056
  var _context_privates_EDITOR_PATH;
10057
10057
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10058
10058
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10059
- const lines = text.split('\n');
10059
+ const lines = text.split('\n').filter((line)=>line !== '');
10060
10060
  const crons = lines.map((line)=>JSON.parse(line));
10061
10061
  const cron = crons.find((cron)=>cron.id === id);
10062
10062
  cron.enabled = false;
package/index.esm.js CHANGED
@@ -9951,7 +9951,7 @@ let CronService = class CronService {
9951
9951
  }
9952
9952
  async start(path) {
9953
9953
  const content = await promises.readFile(`${path}/planning.json`, 'utf8');
9954
- const lines = content.split('\n');
9954
+ const lines = content.split('\n').filter((line)=>line !== '');
9955
9955
  const planning = lines.map((line)=>JSON.parse(line));
9956
9956
  for (const plan of planning){
9957
9957
  const job = new dist.CronJob(plan.time, async ()=>{
@@ -9996,7 +9996,7 @@ let CronService = class CronService {
9996
9996
  var _context_privates_EDITOR_PATH;
9997
9997
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
9998
9998
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
9999
- const lines = text.split('\n');
9999
+ const lines = text.split('\n').filter((line)=>line !== '');
10000
10000
  const crons = lines.map((line)=>JSON.parse(line));
10001
10001
  return crons;
10002
10002
  }
@@ -10020,7 +10020,7 @@ let CronService = class CronService {
10020
10020
  var _context_privates_EDITOR_PATH;
10021
10021
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10022
10022
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10023
- const lines = text.split('\n');
10023
+ const lines = text.split('\n').filter((line)=>line !== '');
10024
10024
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10025
10025
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10026
10026
  this.deleteJob(id);
@@ -10034,7 +10034,7 @@ let CronService = class CronService {
10034
10034
  var _context_privates_EDITOR_PATH;
10035
10035
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10036
10036
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10037
- const lines = text.split('\n');
10037
+ const lines = text.split('\n').filter((line)=>line !== '');
10038
10038
  const crons = lines.map((line)=>JSON.parse(line));
10039
10039
  const cron = crons.find((cron)=>cron.id === id);
10040
10040
  cron.enabled = true;
@@ -10048,7 +10048,7 @@ let CronService = class CronService {
10048
10048
  var _context_privates_EDITOR_PATH;
10049
10049
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10050
10050
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10051
- const lines = text.split('\n');
10051
+ const lines = text.split('\n').filter((line)=>line !== '');
10052
10052
  const crons = lines.map((line)=>JSON.parse(line));
10053
10053
  const cron = crons.find((cron)=>cron.id === id);
10054
10054
  cron.enabled = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-cron",
3
- "version": "0.21.12",
3
+ "version": "0.21.13",
4
4
  "dependencies": {
5
5
  "cron": "^3.1.7"
6
6
  },