From 751d3d7e358e428ddcc3274508b0fad839900c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Mon, 3 Oct 2022 12:40:19 +0000 Subject: [PATCH 1/2] don't require child_process in browsers --- lib/cron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cron.js b/lib/cron.js index 5cd273ea..fd67555b 100644 --- a/lib/cron.js +++ b/lib/cron.js @@ -2,7 +2,7 @@ if (typeof define === 'function' && define.amd) { define(['luxon'], factory); } else if (typeof exports === 'object') { - module.exports = factory(require('luxon'), require('child_process')); + module.exports = factory(require('luxon'), (typeof window === 'undefined' ? require('child_process') : {})); } else { root.Cron = factory(root.luxon); } From c15b00336c6d14e23d040d6db473117600820569 Mon Sep 17 00:00:00 2001 From: Pierre Cavin Date: Tue, 15 Aug 2023 18:41:44 +0200 Subject: [PATCH 2/2] style: fix linter issues --- lib/cron.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cron.js b/lib/cron.js index fd67555b..86189ee2 100644 --- a/lib/cron.js +++ b/lib/cron.js @@ -2,7 +2,10 @@ if (typeof define === 'function' && define.amd) { define(['luxon'], factory); } else if (typeof exports === 'object') { - module.exports = factory(require('luxon'), (typeof window === 'undefined' ? require('child_process') : {})); + module.exports = factory( + require('luxon'), + typeof window === 'undefined' ? require('child_process') : {} + ); } else { root.Cron = factory(root.luxon); }