@nocobase/plugin-workflow 1.2.13-alpha → 1.3.0-alpha.20240710084543
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/package.json +3 -3
- package/dist/client/AddButton.d.ts +0 -16
- package/dist/client/Branch.d.ts +0 -17
- package/dist/client/CanvasContent.d.ts +0 -12
- package/dist/client/ExecutionCanvas.d.ts +0 -10
- package/dist/client/ExecutionContextProvider.d.ts +0 -15
- package/dist/client/ExecutionLink.d.ts +0 -10
- package/dist/client/ExecutionPage.d.ts +0 -10
- package/dist/client/ExecutionResourceProvider.d.ts +0 -14
- package/dist/client/FlowContext.d.ts +0 -11
- package/dist/client/WorkflowCanvas.d.ts +0 -10
- package/dist/client/WorkflowLink.d.ts +0 -10
- package/dist/client/WorkflowPage.d.ts +0 -10
- package/dist/client/WorkflowPane.d.ts +0 -10
- package/dist/client/components/AssignedFieldsFormSchemaConfig.d.ts +0 -10
- package/dist/client/components/CheckboxGroupWithTooltip.d.ts +0 -15
- package/dist/client/components/CollectionBlockInitializer.d.ts +0 -10
- package/dist/client/components/CollectionFieldset.d.ts +0 -14
- package/dist/client/components/DetailsBlockProvider.d.ts +0 -14
- package/dist/client/components/DrawerDescription.d.ts +0 -10
- package/dist/client/components/DrawerForm.d.ts +0 -13
- package/dist/client/components/ExecutionStatus.d.ts +0 -13
- package/dist/client/components/FieldsSelect.d.ts +0 -10
- package/dist/client/components/FilterDynamicComponent.d.ts +0 -14
- package/dist/client/components/OpenDrawer.d.ts +0 -14
- package/dist/client/components/RadioWithTooltip.d.ts +0 -15
- package/dist/client/components/SimpleDesigner.d.ts +0 -10
- package/dist/client/components/StatusButton.d.ts +0 -10
- package/dist/client/components/TriggerOptionRender.d.ts +0 -12
- package/dist/client/components/ValueBlock.d.ts +0 -14
- package/dist/client/components/index.d.ts +0 -16
- package/dist/client/components/renderEngineReference.d.ts +0 -10
- package/dist/client/constants.d.ts +0 -45
- package/dist/client/hooks/index.d.ts +0 -11
- package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +0 -14
- package/dist/client/hooks/useRefreshActionProps.d.ts +0 -11
- package/dist/client/hooks/useTriggerWorkflowActionProps.d.ts +0 -20
- package/dist/client/hooks/useWorkflowExecuted.d.ts +0 -10
- package/dist/client/index.d.ts +0 -43
- package/dist/client/index.js +0 -569
- package/dist/client/locale/index.d.ts +0 -11
- package/dist/client/nodes/calculation.d.ts +0 -80
- package/dist/client/nodes/condition.d.ts +0 -108
- package/dist/client/nodes/create.d.ts +0 -110
- package/dist/client/nodes/destroy.d.ts +0 -54
- package/dist/client/nodes/end.d.ts +0 -30
- package/dist/client/nodes/index.d.ts +0 -76
- package/dist/client/nodes/query.d.ts +0 -236
- package/dist/client/nodes/update.d.ts +0 -114
- package/dist/client/schemas/collection.d.ts +0 -170
- package/dist/client/schemas/executions.d.ts +0 -282
- package/dist/client/schemas/workflows.d.ts +0 -10
- package/dist/client/settings/customizeSubmitToWorkflowActionSettings.d.ts +0 -10
- package/dist/client/style.d.ts +0 -30
- package/dist/client/triggers/collection.d.ts +0 -124
- package/dist/client/triggers/index.d.ts +0 -36
- package/dist/client/triggers/schedule/EndsByField.d.ts +0 -13
- package/dist/client/triggers/schedule/OnField.d.ts +0 -13
- package/dist/client/triggers/schedule/RepeatField.d.ts +0 -13
- package/dist/client/triggers/schedule/ScheduleConfig.d.ts +0 -10
- package/dist/client/triggers/schedule/constants.d.ts +0 -12
- package/dist/client/triggers/schedule/index.d.ts +0 -33
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -42
- package/dist/client/utils.d.ts +0 -12
- package/dist/client/variable.d.ts +0 -93
- package/dist/externalVersion.js +0 -34
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -98
- package/dist/locale/es-ES.json +0 -98
- package/dist/locale/fr-FR.json +0 -98
- package/dist/locale/ja-JP.json +0 -82
- package/dist/locale/ko_KR.json +0 -168
- package/dist/locale/pt-BR.json +0 -98
- package/dist/locale/ru-RU.json +0 -82
- package/dist/locale/tr-TR.json +0 -82
- package/dist/locale/zh-CN.json +0 -205
- package/dist/node_modules/cron-parser/.eslintrc.json +0 -15
- package/dist/node_modules/cron-parser/.travis.yml +0 -7
- package/dist/node_modules/cron-parser/LICENSE +0 -21
- package/dist/node_modules/cron-parser/component.json +0 -11
- package/dist/node_modules/cron-parser/index.d.ts +0 -1
- package/dist/node_modules/cron-parser/lib/date.js +0 -252
- package/dist/node_modules/cron-parser/lib/expression.js +0 -983
- package/dist/node_modules/cron-parser/lib/field_compactor.js +0 -70
- package/dist/node_modules/cron-parser/lib/field_stringify.js +0 -38
- package/dist/node_modules/cron-parser/lib/parser.js +0 -1
- package/dist/node_modules/cron-parser/node_modules/luxon/build/amd/luxon.js +0 -8489
- package/dist/node_modules/cron-parser/node_modules/luxon/build/cjs-browser/luxon.js +0 -8487
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.js +0 -8490
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.min.js +0 -1
- package/dist/node_modules/cron-parser/node_modules/luxon/build/node/luxon.js +0 -7522
- package/dist/node_modules/cron-parser/node_modules/luxon/package.json +0 -96
- package/dist/node_modules/cron-parser/node_modules/luxon/src/datetime.js +0 -2169
- package/dist/node_modules/cron-parser/node_modules/luxon/src/duration.js +0 -880
- package/dist/node_modules/cron-parser/node_modules/luxon/src/errors.js +0 -61
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/conversions.js +0 -157
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/diff.js +0 -80
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/digits.js +0 -76
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/english.js +0 -233
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formats.js +0 -191
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formatter.js +0 -386
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/invalid.js +0 -14
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/locale.js +0 -482
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/regexParser.js +0 -335
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/tokenParser.js +0 -424
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/util.js +0 -292
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/zoneUtil.js +0 -36
- package/dist/node_modules/cron-parser/node_modules/luxon/src/info.js +0 -193
- package/dist/node_modules/cron-parser/node_modules/luxon/src/interval.js +0 -602
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxon.js +0 -26
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxonFilled.js +0 -13
- package/dist/node_modules/cron-parser/node_modules/luxon/src/settings.js +0 -137
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zone.js +0 -88
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/IANAZone.js +0 -191
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -94
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/invalidZone.js +0 -53
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/localZone.js +0 -63
- package/dist/node_modules/cron-parser/package.json +0 -1
- package/dist/node_modules/cron-parser/test/31_of_month.js +0 -17
- package/dist/node_modules/cron-parser/test/bug.js +0 -29
- package/dist/node_modules/cron-parser/test/crondate.js +0 -16
- package/dist/node_modules/cron-parser/test/crontab.example +0 -7
- package/dist/node_modules/cron-parser/test/empty_around_comma.js +0 -22
- package/dist/node_modules/cron-parser/test/expression.js +0 -1489
- package/dist/node_modules/cron-parser/test/field_compactor.js +0 -250
- package/dist/node_modules/cron-parser/test/field_stringify.js +0 -84
- package/dist/node_modules/cron-parser/test/fields.js +0 -32
- package/dist/node_modules/cron-parser/test/increment_on_first_iteration.js +0 -22
- package/dist/node_modules/cron-parser/test/index-ts3.test-d.ts +0 -133
- package/dist/node_modules/cron-parser/test/index.test-d.ts +0 -138
- package/dist/node_modules/cron-parser/test/leap_year.js +0 -17
- package/dist/node_modules/cron-parser/test/parser.js +0 -46
- package/dist/node_modules/cron-parser/test/parser_crondate_formats.js +0 -145
- package/dist/node_modules/cron-parser/test/parser_day_of_month.js +0 -169
- package/dist/node_modules/cron-parser/test/prev_date.js +0 -32
- package/dist/node_modules/cron-parser/test/stringify.js +0 -402
- package/dist/node_modules/cron-parser/test/timezone.js +0 -422
- package/dist/node_modules/cron-parser/types/common.d.ts +0 -131
- package/dist/node_modules/cron-parser/types/index.d.ts +0 -45
- package/dist/node_modules/cron-parser/types/ts3/index.d.ts +0 -28
- package/dist/node_modules/lru-cache/LICENSE +0 -15
- package/dist/node_modules/lru-cache/dist/cjs/index-cjs.d.ts +0 -7
- package/dist/node_modules/lru-cache/dist/cjs/index-cjs.js +0 -1
- package/dist/node_modules/lru-cache/dist/cjs/index.d.ts +0 -807
- package/dist/node_modules/lru-cache/dist/cjs/index.js +0 -1334
- package/dist/node_modules/lru-cache/dist/cjs/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/cjs/package.json +0 -3
- package/dist/node_modules/lru-cache/dist/mjs/index.d.ts +0 -807
- package/dist/node_modules/lru-cache/dist/mjs/index.js +0 -1330
- package/dist/node_modules/lru-cache/dist/mjs/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/mjs/package.json +0 -3
- package/dist/node_modules/lru-cache/package.json +0 -1
- package/dist/server/Plugin.d.ts +0 -84
- package/dist/server/Plugin.js +0 -503
- package/dist/server/Processor.d.ts +0 -115
- package/dist/server/Processor.js +0 -363
- package/dist/server/actions/executions.d.ts +0 -11
- package/dist/server/actions/executions.js +0 -96
- package/dist/server/actions/index.d.ts +0 -11
- package/dist/server/actions/index.js +0 -66
- package/dist/server/actions/nodes.d.ts +0 -12
- package/dist/server/actions/nodes.js +0 -217
- package/dist/server/actions/workflows.d.ts +0 -14
- package/dist/server/actions/workflows.js +0 -184
- package/dist/server/collections/executions.d.ts +0 -11
- package/dist/server/collections/executions.js +0 -66
- package/dist/server/collections/flow_nodes.d.ts +0 -11
- package/dist/server/collections/flow_nodes.js +0 -87
- package/dist/server/collections/jobs.d.ts +0 -11
- package/dist/server/collections/jobs.js +0 -66
- package/dist/server/collections/workflows.d.ts +0 -10
- package/dist/server/collections/workflows.js +0 -126
- package/dist/server/constants.d.ts +0 -29
- package/dist/server/constants.js +0 -58
- package/dist/server/functions/index.d.ts +0 -17
- package/dist/server/functions/index.js +0 -40
- package/dist/server/index.d.ts +0 -15
- package/dist/server/index.js +0 -60
- package/dist/server/instructions/CalculationInstruction.d.ts +0 -25
- package/dist/server/instructions/CalculationInstruction.js +0 -59
- package/dist/server/instructions/ConditionInstruction.d.ts +0 -36
- package/dist/server/instructions/ConditionInstruction.js +0 -167
- package/dist/server/instructions/CreateInstruction.d.ts +0 -18
- package/dist/server/instructions/CreateInstruction.js +0 -75
- package/dist/server/instructions/DestroyInstruction.d.ts +0 -18
- package/dist/server/instructions/DestroyInstruction.js +0 -59
- package/dist/server/instructions/EndInstruction.d.ts +0 -14
- package/dist/server/instructions/EndInstruction.js +0 -55
- package/dist/server/instructions/QueryInstruction.d.ts +0 -21
- package/dist/server/instructions/QueryInstruction.js +0 -82
- package/dist/server/instructions/UpdateInstruction.d.ts +0 -18
- package/dist/server/instructions/UpdateInstruction.js +0 -59
- package/dist/server/instructions/index.d.ts +0 -31
- package/dist/server/instructions/index.js +0 -42
- package/dist/server/migrations/20221129153547-calculation-variables.d.ts +0 -14
- package/dist/server/migrations/20221129153547-calculation-variables.js +0 -92
- package/dist/server/migrations/20230221032941-change-request-body-type.d.ts +0 -14
- package/dist/server/migrations/20230221032941-change-request-body-type.js +0 -102
- package/dist/server/migrations/20230221071831-calculation-expression.d.ts +0 -13
- package/dist/server/migrations/20230221071831-calculation-expression.js +0 -121
- package/dist/server/migrations/20230221121203-condition-calculation.d.ts +0 -13
- package/dist/server/migrations/20230221121203-condition-calculation.js +0 -106
- package/dist/server/migrations/20230221162902-jsonb-to-json.d.ts +0 -13
- package/dist/server/migrations/20230221162902-jsonb-to-json.js +0 -63
- package/dist/server/migrations/20230411034722-manual-multi-form.d.ts +0 -13
- package/dist/server/migrations/20230411034722-manual-multi-form.js +0 -283
- package/dist/server/migrations/20230612021134-manual-collection-block.d.ts +0 -13
- package/dist/server/migrations/20230612021134-manual-collection-block.js +0 -152
- package/dist/server/migrations/20230710115902-manual-action-values.d.ts +0 -13
- package/dist/server/migrations/20230710115902-manual-action-values.js +0 -101
- package/dist/server/migrations/20230809113132-workflow-options.d.ts +0 -13
- package/dist/server/migrations/20230809113132-workflow-options.js +0 -64
- package/dist/server/migrations/20231024172342-add-node-key.d.ts +0 -13
- package/dist/server/migrations/20231024172342-add-node-key.js +0 -90
- package/dist/server/migrations/20231122143143-split-to-plugins.d.ts +0 -13
- package/dist/server/migrations/20231122143143-split-to-plugins.js +0 -67
- package/dist/server/migrations/20240115220721-add-node-key-to-job.d.ts +0 -14
- package/dist/server/migrations/20240115220721-add-node-key-to-job.js +0 -63
- package/dist/server/migrations/20240613222612-fix-assign-field-config.d.ts +0 -13
- package/dist/server/migrations/20240613222612-fix-assign-field-config.js +0 -62
- package/dist/server/triggers/CollectionTrigger.d.ts +0 -22
- package/dist/server/triggers/CollectionTrigger.js +0 -184
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +0 -39
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +0 -356
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +0 -21
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +0 -152
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +0 -18
- package/dist/server/triggers/ScheduleTrigger/index.js +0 -84
- package/dist/server/triggers/ScheduleTrigger/utils.d.ts +0 -13
- package/dist/server/triggers/ScheduleTrigger/utils.js +0 -44
- package/dist/server/triggers/index.d.ts +0 -21
- package/dist/server/triggers/index.js +0 -46
- package/dist/server/types/Execution.d.ts +0 -25
- package/dist/server/types/Execution.js +0 -34
- package/dist/server/types/FlowNode.d.ts +0 -24
- package/dist/server/types/FlowNode.js +0 -34
- package/dist/server/types/Job.d.ts +0 -22
- package/dist/server/types/Job.js +0 -34
- package/dist/server/types/Workflow.d.ts +0 -35
- package/dist/server/types/Workflow.js +0 -34
- package/dist/server/types/index.d.ts +0 -12
- package/dist/server/types/index.js +0 -24
- package/dist/server/utils.d.ts +0 -9
- package/dist/server/utils.js +0 -51
- package/dist/swagger/index.d.ts +0 -762
- package/dist/swagger/index.js +0 -807
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
var test = require('tap').test;
|
|
2
|
-
var CronExpression = require('../lib/expression');
|
|
3
|
-
|
|
4
|
-
test('It works on DST start', function(t) {
|
|
5
|
-
try {
|
|
6
|
-
var options = {
|
|
7
|
-
currentDate: '2016-03-27 02:00:01',
|
|
8
|
-
tz: 'Europe/Athens'
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
var interval, date;
|
|
12
|
-
|
|
13
|
-
interval = CronExpression.parse('0 * * * *', options);
|
|
14
|
-
t.ok(interval, 'Interval parsed');
|
|
15
|
-
|
|
16
|
-
date = interval.next();
|
|
17
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
18
|
-
t.equal(date.getHours(), 4, 'Due to DST start in Athens, 3 is skipped');
|
|
19
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
20
|
-
|
|
21
|
-
date = interval.next();
|
|
22
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
23
|
-
t.equal(date.getHours(), 5, '5 AM');
|
|
24
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
25
|
-
|
|
26
|
-
interval = CronExpression.parse('30 2 * * *', options);
|
|
27
|
-
t.ok(interval, 'Interval parsed');
|
|
28
|
-
|
|
29
|
-
date = interval.next();
|
|
30
|
-
t.equal(date.getMinutes(), 30, '30 Minutes');
|
|
31
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
32
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
33
|
-
|
|
34
|
-
date = interval.next();
|
|
35
|
-
t.equal(date.getMinutes(), 30, '30 Minutes');
|
|
36
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
37
|
-
t.equal(date.getDate(), 28, 'on the 28th');
|
|
38
|
-
|
|
39
|
-
interval = CronExpression.parse('0 3 * * *', options);
|
|
40
|
-
t.ok(interval, 'Interval parsed');
|
|
41
|
-
|
|
42
|
-
date = interval.next();
|
|
43
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
44
|
-
t.equal(date.getHours(), 4, 'Due to DST start in Athens, 3 is skipped');
|
|
45
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
46
|
-
|
|
47
|
-
date = interval.next();
|
|
48
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
49
|
-
t.equal(date.getHours(), 3, '3 on the 28th');
|
|
50
|
-
t.equal(date.getDate(), 28, 'on the 28th');
|
|
51
|
-
|
|
52
|
-
interval = CronExpression.parse('*/20 3 * * *', options);
|
|
53
|
-
t.ok(interval, 'Interval parsed');
|
|
54
|
-
|
|
55
|
-
date = interval.next();
|
|
56
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
57
|
-
t.equal(date.getHours(), 4, 'Due to DST start in Athens, 3 is skipped');
|
|
58
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
59
|
-
|
|
60
|
-
date = interval.next();
|
|
61
|
-
t.equal(date.getMinutes(), 20, '20 Minutes');
|
|
62
|
-
t.equal(date.getHours(), 4, 'Due to DST start in Athens, 3 is skipped');
|
|
63
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
64
|
-
|
|
65
|
-
date = interval.next();
|
|
66
|
-
t.equal(date.getMinutes(), 40, '20 Minutes');
|
|
67
|
-
t.equal(date.getHours(), 4, 'Due to DST start in Athens, 3 is skipped');
|
|
68
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
69
|
-
|
|
70
|
-
date = interval.next();
|
|
71
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
72
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
73
|
-
t.equal(date.getDate(), 28, 'on the 28th');
|
|
74
|
-
|
|
75
|
-
options.currentDate = '2016-03-27 00:00:01';
|
|
76
|
-
|
|
77
|
-
interval = CronExpression.parse('0 * 27 * *', options);
|
|
78
|
-
t.ok(interval, 'Interval parsed');
|
|
79
|
-
|
|
80
|
-
date = interval.next();
|
|
81
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
82
|
-
t.equal(date.getHours(), 1, '1 AM');
|
|
83
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
84
|
-
|
|
85
|
-
date = interval.next();
|
|
86
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
87
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
88
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
89
|
-
|
|
90
|
-
date = interval.next();
|
|
91
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
92
|
-
t.equal(date.getHours(), 4, '4 AM');
|
|
93
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
94
|
-
|
|
95
|
-
date = interval.next();
|
|
96
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
97
|
-
t.equal(date.getHours(), 5, '5 AM');
|
|
98
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
99
|
-
|
|
100
|
-
options.currentDate = '2016-03-27 00:00:01';
|
|
101
|
-
options.endDate = '2016-03-27 03:00:01';
|
|
102
|
-
|
|
103
|
-
interval = CronExpression.parse('0 * * * *', options);
|
|
104
|
-
t.ok(interval, 'Interval parsed');
|
|
105
|
-
|
|
106
|
-
date = interval.next();
|
|
107
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
108
|
-
t.equal(date.getHours(), 1, '1 AM');
|
|
109
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
110
|
-
|
|
111
|
-
date = interval.next();
|
|
112
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
113
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
114
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
115
|
-
|
|
116
|
-
date = interval.next();
|
|
117
|
-
t.equal(date.getMinutes(), 0, '0 Minutes');
|
|
118
|
-
t.equal(date.getHours(), 4, '4 AM');
|
|
119
|
-
t.equal(date.getDate(), 27, 'on the 27th');
|
|
120
|
-
|
|
121
|
-
// Out of the timespan range
|
|
122
|
-
t.throws(function() {
|
|
123
|
-
date = interval.next();
|
|
124
|
-
});
|
|
125
|
-
} catch (err) {
|
|
126
|
-
t.error(err, 'Interval parse error');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
t.end();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test('It works on DST end', function(t) {
|
|
133
|
-
try {
|
|
134
|
-
var options = {
|
|
135
|
-
currentDate: '2016-10-30 02:00:01',
|
|
136
|
-
tz: 'Europe/Athens'
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
var interval, date;
|
|
140
|
-
|
|
141
|
-
interval = CronExpression.parse('0 * * * *', options);
|
|
142
|
-
t.ok(interval, 'Interval parsed');
|
|
143
|
-
|
|
144
|
-
date = interval.next();
|
|
145
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
146
|
-
t.equal(date.getDate(), 30, '30th');
|
|
147
|
-
|
|
148
|
-
date = interval.next();
|
|
149
|
-
t.equal(date.getHours(), 3, 'Due to DST end in Athens (4-->3)');
|
|
150
|
-
t.equal(date.getDate(), 30, '30th');
|
|
151
|
-
|
|
152
|
-
date = interval.next();
|
|
153
|
-
t.equal(date.getHours(), 4, '4 AM');
|
|
154
|
-
t.equal(date.getDate(), 30, '30th');
|
|
155
|
-
|
|
156
|
-
interval = CronExpression.parse('0 3 * * *', options);
|
|
157
|
-
t.ok(interval, 'Interval parsed');
|
|
158
|
-
|
|
159
|
-
date = interval.next();
|
|
160
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
161
|
-
t.equal(date.getDate(), 30, '30th');
|
|
162
|
-
|
|
163
|
-
date = interval.next();
|
|
164
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
165
|
-
t.equal(date.getDate(), 31, '31st');
|
|
166
|
-
|
|
167
|
-
interval = CronExpression.parse('*/20 3 * * *', options);
|
|
168
|
-
t.ok(interval, 'Interval parsed');
|
|
169
|
-
|
|
170
|
-
date = interval.next();
|
|
171
|
-
t.equal(date.getMinutes(), 0, '0');
|
|
172
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
173
|
-
t.equal(date.getDate(), 30, '30th');
|
|
174
|
-
|
|
175
|
-
date = interval.next();
|
|
176
|
-
t.equal(date.getMinutes(), 20, '20');
|
|
177
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
178
|
-
t.equal(date.getDate(), 30, '30th');
|
|
179
|
-
|
|
180
|
-
date = interval.next();
|
|
181
|
-
t.equal(date.getMinutes(), 40, '40');
|
|
182
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
183
|
-
t.equal(date.getDate(), 30, '30th');
|
|
184
|
-
|
|
185
|
-
date = interval.next();
|
|
186
|
-
t.equal(date.getMinutes(), 0, '0');
|
|
187
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
188
|
-
t.equal(date.getDate(), 31, '31st');
|
|
189
|
-
|
|
190
|
-
options.currentDate = '2016-10-30 00:00:01';
|
|
191
|
-
|
|
192
|
-
interval = CronExpression.parse('0 * 30 * *', options);
|
|
193
|
-
t.ok(interval, 'Interval parsed');
|
|
194
|
-
|
|
195
|
-
date = interval.next();
|
|
196
|
-
t.equal(date.getHours(), 1, '1 AM');
|
|
197
|
-
t.equal(date.getDate(), 30, '30th');
|
|
198
|
-
|
|
199
|
-
date = interval.next();
|
|
200
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
201
|
-
t.equal(date.getDate(), 30, '30th');
|
|
202
|
-
|
|
203
|
-
date = interval.next();
|
|
204
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
205
|
-
t.equal(date.getDate(), 30, '30th');
|
|
206
|
-
|
|
207
|
-
date = interval.next();
|
|
208
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
209
|
-
t.equal(date.getDate(), 30, '30th');
|
|
210
|
-
|
|
211
|
-
date = interval.next();
|
|
212
|
-
t.equal(date.getHours(), 4, '4 AM');
|
|
213
|
-
t.equal(date.getDate(), 30, '30th');
|
|
214
|
-
|
|
215
|
-
options.currentDate = '2016-10-30 00:00:01';
|
|
216
|
-
// specify the DST offset via ISO 8601 format, as 3am is repeated
|
|
217
|
-
options.endDate = '2016-10-30T03:00:01+03';
|
|
218
|
-
|
|
219
|
-
interval = CronExpression.parse('0 * * * *', options);
|
|
220
|
-
t.ok(interval, 'Interval parsed');
|
|
221
|
-
|
|
222
|
-
date = interval.next();
|
|
223
|
-
t.equal(date.getHours(), 1, '1 AM');
|
|
224
|
-
t.equal(date.getDate(), 30, '30th');
|
|
225
|
-
|
|
226
|
-
date = interval.next();
|
|
227
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
228
|
-
t.equal(date.getDate(), 30, '30th');
|
|
229
|
-
|
|
230
|
-
date = interval.next();
|
|
231
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
232
|
-
t.equal(date.getDate(), 30, '30th');
|
|
233
|
-
|
|
234
|
-
// Out of the timespan range
|
|
235
|
-
t.throws(function() {
|
|
236
|
-
date = interval.next();
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
options.endDate = '2016-10-30 04:00:01';
|
|
240
|
-
|
|
241
|
-
interval = CronExpression.parse('0 * * * *', options);
|
|
242
|
-
t.ok(interval, 'Interval parsed');
|
|
243
|
-
|
|
244
|
-
date = interval.next();
|
|
245
|
-
t.equal(date.getHours(), 1, '1 AM');
|
|
246
|
-
t.equal(date.getDate(), 30, '30th');
|
|
247
|
-
|
|
248
|
-
date = interval.next();
|
|
249
|
-
t.equal(date.getHours(), 2, '2 AM');
|
|
250
|
-
t.equal(date.getDate(), 30, '30th');
|
|
251
|
-
|
|
252
|
-
date = interval.next();
|
|
253
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
254
|
-
t.equal(date.getDate(), 30, '30th');
|
|
255
|
-
|
|
256
|
-
date = interval.next();
|
|
257
|
-
t.equal(date.getHours(), 3, '3 AM');
|
|
258
|
-
t.equal(date.getDate(), 30, '30th');
|
|
259
|
-
|
|
260
|
-
date = interval.next();
|
|
261
|
-
t.equal(date.getHours(), 4, '4 AM');
|
|
262
|
-
t.equal(date.getDate(), 30, '30th');
|
|
263
|
-
|
|
264
|
-
// Out of the timespan range
|
|
265
|
-
t.throws(function() {
|
|
266
|
-
date = interval.next();
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
options = {
|
|
270
|
-
currentDate : new Date('Sun Oct 29 2016 01:00:00 GMT+0200')
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
274
|
-
t.ok(interval, 'Interval parsed');
|
|
275
|
-
|
|
276
|
-
date = interval.next();
|
|
277
|
-
t.equal(date.getHours(), 12, '12');
|
|
278
|
-
t.equal(date.getDate(), 29, '29th');
|
|
279
|
-
date = interval.next();
|
|
280
|
-
t.equal(date.getHours(), 12, '12');
|
|
281
|
-
t.equal(date.getDate(), 30, '30th');
|
|
282
|
-
date = interval.next();
|
|
283
|
-
t.equal(date.getHours(), 12, '12');
|
|
284
|
-
t.equal(date.getDate(), 31, '31st');
|
|
285
|
-
|
|
286
|
-
options = {
|
|
287
|
-
currentDate : new Date('Sun Oct 29 2016 02:59:00 GMT+0200')
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
291
|
-
t.ok(interval, 'Interval parsed');
|
|
292
|
-
|
|
293
|
-
date = interval.next();
|
|
294
|
-
t.equal(date.getHours(), 12, '12');
|
|
295
|
-
t.equal(date.getDate(), 29, '29th');
|
|
296
|
-
date = interval.next();
|
|
297
|
-
t.equal(date.getHours(), 12, '12');
|
|
298
|
-
t.equal(date.getDate(), 30, '30th');
|
|
299
|
-
date = interval.next();
|
|
300
|
-
t.equal(date.getHours(), 12, '12');
|
|
301
|
-
t.equal(date.getDate(), 31, '31st');
|
|
302
|
-
|
|
303
|
-
options = {
|
|
304
|
-
currentDate : new Date('Sun Oct 29 2016 02:59:59 GMT+0200')
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
308
|
-
t.ok(interval, 'Interval parsed');
|
|
309
|
-
|
|
310
|
-
date = interval.next();
|
|
311
|
-
t.equal(date.getHours(), 12, '12');
|
|
312
|
-
t.equal(date.getDate(), 29, '29th');
|
|
313
|
-
date = interval.next();
|
|
314
|
-
t.equal(date.getHours(), 12, '12');
|
|
315
|
-
t.equal(date.getDate(), 30, '30th');
|
|
316
|
-
date = interval.next();
|
|
317
|
-
t.equal(date.getHours(), 12, '12');
|
|
318
|
-
t.equal(date.getDate(), 31, '31st');
|
|
319
|
-
|
|
320
|
-
options = {
|
|
321
|
-
currentDate : new Date('Sun Oct 30 2016 01:00:00 GMT+0200')
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
325
|
-
t.ok(interval, 'Interval parsed');
|
|
326
|
-
|
|
327
|
-
date = interval.next();
|
|
328
|
-
t.equal(date.getHours(), 12, '12');
|
|
329
|
-
t.equal(date.getDate(), 30, '30th');
|
|
330
|
-
date = interval.next();
|
|
331
|
-
t.equal(date.getHours(), 12, '12');
|
|
332
|
-
t.equal(date.getDate(), 31, '31st');
|
|
333
|
-
|
|
334
|
-
options = {
|
|
335
|
-
currentDate : new Date('Sun Oct 30 2016 01:59:00 GMT+0200')
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
339
|
-
t.ok(interval, 'Interval parsed');
|
|
340
|
-
|
|
341
|
-
date = interval.next();
|
|
342
|
-
t.equal(date.getHours(), 12, '12');
|
|
343
|
-
t.equal(date.getDate(), 30, '30th');
|
|
344
|
-
date = interval.next();
|
|
345
|
-
t.equal(date.getHours(), 12, '12');
|
|
346
|
-
t.equal(date.getDate(), 31, '31st');
|
|
347
|
-
|
|
348
|
-
options = {
|
|
349
|
-
currentDate : new Date('Sun Oct 30 2016 01:59:59 GMT+0200')
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
353
|
-
t.ok(interval, 'Interval parsed');
|
|
354
|
-
|
|
355
|
-
date = interval.next();
|
|
356
|
-
t.equal(date.getHours(), 12, '12');
|
|
357
|
-
t.equal(date.getDate(), 30, '30th');
|
|
358
|
-
date = interval.next();
|
|
359
|
-
t.equal(date.getHours(), 12, '12');
|
|
360
|
-
t.equal(date.getDate(), 31, '31st');
|
|
361
|
-
|
|
362
|
-
options = {
|
|
363
|
-
currentDate : new Date('Sun Oct 30 2016 02:59:00 GMT+0200')
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
interval = CronExpression.parse('0 12 * * *', options);
|
|
367
|
-
t.ok(interval, 'Interval parsed');
|
|
368
|
-
|
|
369
|
-
date = interval.next();
|
|
370
|
-
t.equal(date.getHours(), 12, '12');
|
|
371
|
-
t.equal(date.getDate(), 30, '30th');
|
|
372
|
-
date = interval.next();
|
|
373
|
-
t.equal(date.getHours(), 12, '12');
|
|
374
|
-
t.equal(date.getDate(), 31, '31st');
|
|
375
|
-
} catch (err) {
|
|
376
|
-
t.error(err, 'Interval parse error');
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
t.end();
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
test('it will work with #131 issue case', function(t) {
|
|
383
|
-
var options = {
|
|
384
|
-
tz: 'America/Sao_Paulo',
|
|
385
|
-
currentDate : new Date('Sun Oct 30 2018 02:59:00 GMT+0200')
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
var interval = CronExpression.parse('0 9 1 1 *', options);
|
|
389
|
-
var date = interval.next();
|
|
390
|
-
|
|
391
|
-
t.equal(date.getFullYear(), 2019);
|
|
392
|
-
t.equal(date.getDate(), 1);
|
|
393
|
-
t.equal(date.getMonth(), 0);
|
|
394
|
-
|
|
395
|
-
date = interval.prev();
|
|
396
|
-
t.equal(date.getFullYear(), 2018);
|
|
397
|
-
t.equal(date.getDate(), 1);
|
|
398
|
-
t.equal(date.getMonth(), 0);
|
|
399
|
-
|
|
400
|
-
date = interval.prev();
|
|
401
|
-
t.equal(date.getFullYear(), 2017);
|
|
402
|
-
t.equal(date.getDate(), 1);
|
|
403
|
-
t.equal(date.getMonth(), 0);
|
|
404
|
-
|
|
405
|
-
t.end();
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
test('it will work with #137 issue case', function(t) {
|
|
409
|
-
var options = {
|
|
410
|
-
tz: 'America/New_York',
|
|
411
|
-
currentDate : new Date('10/28/2018')
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
var interval = CronExpression.parse('0 12 * * 3', options);
|
|
415
|
-
var date = interval.next();
|
|
416
|
-
|
|
417
|
-
t.equal(date.getFullYear(), 2018);
|
|
418
|
-
t.equal(date.getDate(), 31);
|
|
419
|
-
t.equal(date.getMonth(), 9);
|
|
420
|
-
|
|
421
|
-
t.end();
|
|
422
|
-
});
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
export type DateType = Date | number | string
|
|
2
|
-
|
|
3
|
-
export interface CronDate {
|
|
4
|
-
addYear(): void
|
|
5
|
-
|
|
6
|
-
addMonth(): void
|
|
7
|
-
|
|
8
|
-
addDay(): void
|
|
9
|
-
|
|
10
|
-
addHour(): void
|
|
11
|
-
|
|
12
|
-
addMinute(): void
|
|
13
|
-
|
|
14
|
-
addSecond(): void
|
|
15
|
-
|
|
16
|
-
subtractYear(): void
|
|
17
|
-
|
|
18
|
-
subtractMonth(): void
|
|
19
|
-
|
|
20
|
-
subtractDay(): void
|
|
21
|
-
|
|
22
|
-
subtractHour(): void
|
|
23
|
-
|
|
24
|
-
subtractMinute(): void
|
|
25
|
-
|
|
26
|
-
subtractSecond(): void
|
|
27
|
-
|
|
28
|
-
getDate(): number
|
|
29
|
-
|
|
30
|
-
getFullYear(): number
|
|
31
|
-
|
|
32
|
-
getDay(): number
|
|
33
|
-
|
|
34
|
-
getMonth(): number
|
|
35
|
-
|
|
36
|
-
getHours(): number
|
|
37
|
-
|
|
38
|
-
getMinutes(): number
|
|
39
|
-
|
|
40
|
-
getSeconds(): number
|
|
41
|
-
|
|
42
|
-
getMilliseconds(): number
|
|
43
|
-
|
|
44
|
-
getTime(): number
|
|
45
|
-
|
|
46
|
-
getUTCDate(): number
|
|
47
|
-
|
|
48
|
-
getUTCFullYear(): number
|
|
49
|
-
|
|
50
|
-
getUTCDay(): number
|
|
51
|
-
|
|
52
|
-
getUTCMonth(): number
|
|
53
|
-
|
|
54
|
-
getUTCHours(): number
|
|
55
|
-
|
|
56
|
-
getUTCMinutes(): number
|
|
57
|
-
|
|
58
|
-
getUTCSeconds(): number
|
|
59
|
-
|
|
60
|
-
toISOString(): string
|
|
61
|
-
|
|
62
|
-
toJSON(): string
|
|
63
|
-
|
|
64
|
-
setDate(d: number): void
|
|
65
|
-
|
|
66
|
-
setFullYear(y: number): void
|
|
67
|
-
|
|
68
|
-
setDay(d: number): void
|
|
69
|
-
|
|
70
|
-
setMonth(m: number): void
|
|
71
|
-
|
|
72
|
-
setHours(h: number): void
|
|
73
|
-
|
|
74
|
-
setMinutes(m: number): void
|
|
75
|
-
|
|
76
|
-
setSeconds(s: number): void
|
|
77
|
-
|
|
78
|
-
setMilliseconds(s: number): void
|
|
79
|
-
|
|
80
|
-
getTime(): number
|
|
81
|
-
|
|
82
|
-
toString(): string
|
|
83
|
-
|
|
84
|
-
toDate(): Date
|
|
85
|
-
|
|
86
|
-
isLastDayOfMonth(): boolean
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ParserOptions<IsIterable extends boolean = false> {
|
|
90
|
-
currentDate?: DateType
|
|
91
|
-
startDate?: DateType
|
|
92
|
-
endDate?: DateType
|
|
93
|
-
utc?: boolean
|
|
94
|
-
tz?: string
|
|
95
|
-
nthDayOfWeek?: number
|
|
96
|
-
iterator?: IsIterable
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
type IteratorResultOrCronDate<IsIterable extends boolean> = IsIterable extends true
|
|
100
|
-
? IteratorResult<CronDate, CronDate>
|
|
101
|
-
: CronDate;
|
|
102
|
-
|
|
103
|
-
export interface ICronExpression<CronFields, IsIterable extends boolean> {
|
|
104
|
-
readonly fields: CronFields;
|
|
105
|
-
|
|
106
|
-
/** Find next suitable date */
|
|
107
|
-
next(): IteratorResultOrCronDate<IsIterable>
|
|
108
|
-
|
|
109
|
-
/** Find previous suitable date */
|
|
110
|
-
prev(): IteratorResultOrCronDate<IsIterable>
|
|
111
|
-
|
|
112
|
-
/** Check if next suitable date exists */
|
|
113
|
-
hasNext(): boolean
|
|
114
|
-
|
|
115
|
-
/** Check if previous suitable date exists */
|
|
116
|
-
hasPrev(): boolean
|
|
117
|
-
|
|
118
|
-
/** Iterate over expression iterator */
|
|
119
|
-
iterate(steps: number, callback?: (item: IteratorResultOrCronDate<IsIterable>, i: number) => void): IteratorResultOrCronDate<IsIterable>[]
|
|
120
|
-
|
|
121
|
-
/** Reset expression iterator state */
|
|
122
|
-
reset(resetDate?: string | number | Date): void
|
|
123
|
-
|
|
124
|
-
stringify(includeSeconds?: boolean): string
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface IStringResult<CronFields> {
|
|
128
|
-
variables: Record<string, string>,
|
|
129
|
-
expressions: ICronExpression<CronFields, false>[],
|
|
130
|
-
errors: Record<string, any>,
|
|
131
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CronDate,
|
|
3
|
-
DateType,
|
|
4
|
-
ICronExpression,
|
|
5
|
-
IStringResult,
|
|
6
|
-
ParserOptions,
|
|
7
|
-
} from './common';
|
|
8
|
-
|
|
9
|
-
type BuildRangeTuple<Current extends [...number[]], Count extends number> =
|
|
10
|
-
Current["length"] extends Count
|
|
11
|
-
? Current
|
|
12
|
-
: BuildRangeTuple<[number, ...Current], Count>
|
|
13
|
-
type RangeTuple<Count extends number> = BuildRangeTuple<[], Count>
|
|
14
|
-
type BuildRange<Current extends number, End extends number, Accu extends [...number[]]> =
|
|
15
|
-
Accu["length"] extends End
|
|
16
|
-
? Current
|
|
17
|
-
: BuildRange<Current | Accu["length"], End, [number, ...Accu]>
|
|
18
|
-
type Range<StartInclusive extends number, EndExclusive extends number> = BuildRange<StartInclusive, EndExclusive, RangeTuple<StartInclusive>>
|
|
19
|
-
|
|
20
|
-
export type SixtyRange = Range<0, 30> | Range<30, 60>; // Typescript restriction on recursion depth
|
|
21
|
-
export type HourRange = Range<0, 24>;
|
|
22
|
-
export type DayOfTheMonthRange = Range<1, 32> | 'L';
|
|
23
|
-
export type MonthRange = Range<1, 13>;
|
|
24
|
-
export type DayOfTheWeekRange = Range<0, 8>;
|
|
25
|
-
|
|
26
|
-
export type CronFields = {
|
|
27
|
-
readonly second: readonly SixtyRange[];
|
|
28
|
-
readonly minute: readonly SixtyRange[];
|
|
29
|
-
readonly hour: readonly HourRange[];
|
|
30
|
-
readonly dayOfMonth: readonly DayOfTheMonthRange[];
|
|
31
|
-
readonly month: readonly MonthRange[];
|
|
32
|
-
readonly dayOfWeek: readonly DayOfTheWeekRange[];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export {ParserOptions, CronDate, DateType}
|
|
36
|
-
export type CronExpression<IsIterable extends boolean = false> = ICronExpression<CronFields, IsIterable>
|
|
37
|
-
export type StringResult = IStringResult<CronFields>
|
|
38
|
-
|
|
39
|
-
export function parseExpression<IsIterable extends boolean = false>(expression: string, options?: ParserOptions<IsIterable>): CronExpression<IsIterable>;
|
|
40
|
-
|
|
41
|
-
export function fieldsToExpression<IsIterable extends boolean = false>(fields: CronFields, options?: ParserOptions<IsIterable>): CronExpression<IsIterable>;
|
|
42
|
-
|
|
43
|
-
export function parseFile(filePath: string, callback: (err: any, data: StringResult) => any): void;
|
|
44
|
-
|
|
45
|
-
export function parseString(data: string): StringResult;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CronDate,
|
|
3
|
-
DateType,
|
|
4
|
-
ICronExpression,
|
|
5
|
-
IStringResult,
|
|
6
|
-
ParserOptions,
|
|
7
|
-
} from '../common';
|
|
8
|
-
|
|
9
|
-
export type CronFields = {
|
|
10
|
-
readonly second: readonly number[];
|
|
11
|
-
readonly minute: readonly number[];
|
|
12
|
-
readonly hour: readonly number[];
|
|
13
|
-
readonly dayOfMonth: readonly (number | 'L')[];
|
|
14
|
-
readonly month: readonly number[];
|
|
15
|
-
readonly dayOfWeek: readonly number[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export {ParserOptions, CronDate, DateType}
|
|
19
|
-
export type CronExpression<IsIterable extends boolean = false> = ICronExpression<CronFields, IsIterable>
|
|
20
|
-
export type StringResult = IStringResult<CronFields>
|
|
21
|
-
|
|
22
|
-
export function parseExpression<IsIterable extends boolean = false>(expression: string, options?: ParserOptions<IsIterable>): CronExpression<IsIterable>;
|
|
23
|
-
|
|
24
|
-
export function fieldsToExpression<IsIterable extends boolean = false>(fields: CronFields, options?: ParserOptions<IsIterable>): CronExpression<IsIterable>;
|
|
25
|
-
|
|
26
|
-
export function parseFile(filePath: string, callback: (err: any, data: StringResult) => any): void;
|
|
27
|
-
|
|
28
|
-
export function parseString(data: string): StringResult;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
The ISC License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
copyright notice and this permission notice appear in all copies.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";var t={914:function(t,e,i){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const n=s(i(947));t.exports=Object.assign(n.default,{default:n.default,LRUCache:n.default})},947:function(t,e){Object.defineProperty(e,"__esModule",{value:true});e.LRUCache=void 0;const i=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const s=new Set;const emitWarning=(t,e,i,s)=>{typeof process==="object"&&process&&typeof process.emitWarning==="function"?process.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};const shouldWarn=t=>!s.has(t);const n=Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t);const getUintArray=t=>!isPosInt(t)?null:t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(t){super(t);this.fill(0)}}class Stack{heap;length;static#t=false;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#t=true;const i=new Stack(t,e);Stack.#t=false;return i}constructor(t,e){if(!Stack.#t){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new e(t);this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#e;#i;#s;#n;#h;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#o;#r;#l;#c;#f;#d;#u;#p;#g;#S;#y;#m;#z;#w;#_;#L;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#z,sizes:t.#y,keyMap:t.#r,keyList:t.#l,valList:t.#c,next:t.#f,prev:t.#d,get head(){return t.#u},get tail(){return t.#p},free:t.#g,isBackgroundFetch:e=>t.#v(e),backgroundFetch:(e,i,s,n)=>t.#k(e,i,s,n),moveToTail:e=>t.#x(e),indexes:e=>t.#F(e),rindexes:e=>t.#A(e),isStale:e=>t.#T(e)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#o}get size(){return this.#a}get fetchMethod(){return this.#h}get dispose(){return this.#s}get disposeAfter(){return this.#n}constructor(t){const{max:e=0,ttl:i,ttlResolution:n=1,ttlAutopurge:h,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:r,dispose:l,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:d,maxSize:u=0,maxEntrySize:p=0,sizeCalculation:g,fetchMethod:S,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:w,ignoreFetchAbort:_}=t;if(e!==0&&!isPosInt(e)){throw new TypeError("max option must be a nonnegative integer")}const L=e?getUintArray(e):Array;if(!L){throw new Error("invalid max value: "+e)}this.#e=e;this.#i=u;this.maxEntrySize=p||this.#i;this.sizeCalculation=g;if(this.sizeCalculation){if(!this.#i&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(S!==undefined&&typeof S!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#h=S;this.#_=!!S;this.#r=new Map;this.#l=new Array(e).fill(undefined);this.#c=new Array(e).fill(undefined);this.#f=new L(e);this.#d=new L(e);this.#u=0;this.#p=0;this.#g=Stack.create(e);this.#a=0;this.#o=0;if(typeof l==="function"){this.#s=l}if(typeof c==="function"){this.#n=c;this.#S=[]}else{this.#n=undefined;this.#S=undefined}this.#w=!!this.#s;this.#L=!!this.#n;this.noDisposeOnSet=!!f;this.noUpdateTTL=!!d;this.noDeleteOnFetchRejection=!!y;this.allowStaleOnFetchRejection=!!z;this.allowStaleOnFetchAbort=!!w;this.ignoreFetchAbort=!!_;if(this.maxEntrySize!==0){if(this.#i!==0){if(!isPosInt(this.#i)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#b()}this.allowStale=!!r;this.noDeleteOnStaleGet=!!m;this.updateAgeOnGet=!!a;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(n)||n===0?n:1;this.ttlAutopurge=!!h;this.ttl=i||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#O()}if(this.#e===0&&this.ttl===0&&this.#i===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#e&&!this.#i){const t="LRU_CACHE_UNBOUNDED";if(shouldWarn(t)){s.add(t);const e="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(e,"UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#r.has(t)?Infinity:0}#O(){const t=new ZeroArray(this.#e);const e=new ZeroArray(this.#e);this.#z=t;this.#m=e;this.#D=(s,n,h=i.now())=>{e[s]=n!==0?h:0;t[s]=n;if(n!==0&&this.ttlAutopurge){const t=setTimeout((()=>{if(this.#T(s)){this.delete(this.#l[s])}}),n+1);if(t.unref){t.unref()}}};this.#E=s=>{e[s]=t[s]!==0?i.now():0};this.#M=(i,n)=>{if(t[n]){const h=t[n];const a=e[n];i.ttl=h;i.start=a;i.now=s||getNow();i.remainingTTL=i.now+h-a}};let s=0;const getNow=()=>{const t=i.now();if(this.ttlResolution>0){s=t;const e=setTimeout((()=>s=0),this.ttlResolution);if(e.unref){e.unref()}}return t};this.getRemainingTTL=i=>{const n=this.#r.get(i);if(n===undefined){return 0}return t[n]===0||e[n]===0?Infinity:e[n]+t[n]-(s||getNow())};this.#T=i=>t[i]!==0&&e[i]!==0&&(s||getNow())-e[i]>t[i]}#E=()=>{};#M=()=>{};#D=()=>{};#T=()=>false;#b(){const t=new ZeroArray(this.#e);this.#o=0;this.#y=t;this.#C=e=>{this.#o-=t[e];t[e]=0};this.#R=(t,e,i,s)=>{if(this.#v(e)){return 0}if(!isPosInt(i)){if(s){if(typeof s!=="function"){throw new TypeError("sizeCalculation must be a function")}i=s(e,t);if(!isPosInt(i)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return i};this.#W=(e,i,s)=>{t[e]=i;if(this.#i){const i=this.#i-t[e];while(this.#o>i){this.#B(true)}}this.#o+=t[e];if(s){s.entrySize=i;s.totalCalculatedSize=this.#o}}}#C=t=>{};#W=(t,e,i)=>{};#R=(t,e,i,s)=>{if(i||s){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#F({allowStale:t=this.allowStale}={}){if(this.#a){for(let e=this.#p;true;){if(!this.#I(e)){break}if(t||!this.#T(e)){yield e}if(e===this.#u){break}else{e=this.#d[e]}}}}*#A({allowStale:t=this.allowStale}={}){if(this.#a){for(let e=this.#u;true;){if(!this.#I(e)){break}if(t||!this.#T(e)){yield e}if(e===this.#p){break}else{e=this.#f[e]}}}}#I(t){return t!==undefined&&this.#r.get(this.#l[t])===t}*entries(){for(const t of this.#F()){if(this.#c[t]!==undefined&&this.#l[t]!==undefined&&!this.#v(this.#c[t])){yield[this.#l[t],this.#c[t]]}}}*rentries(){for(const t of this.#A()){if(this.#c[t]!==undefined&&this.#l[t]!==undefined&&!this.#v(this.#c[t])){yield[this.#l[t],this.#c[t]]}}}*keys(){for(const t of this.#F()){const e=this.#l[t];if(e!==undefined&&!this.#v(this.#c[t])){yield e}}}*rkeys(){for(const t of this.#A()){const e=this.#l[t];if(e!==undefined&&!this.#v(this.#c[t])){yield e}}}*values(){for(const t of this.#F()){const e=this.#c[t];if(e!==undefined&&!this.#v(this.#c[t])){yield this.#c[t]}}}*rvalues(){for(const t of this.#A()){const e=this.#c[t];if(e!==undefined&&!this.#v(this.#c[t])){yield this.#c[t]}}}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const i of this.#F()){const s=this.#c[i];const n=this.#v(s)?s.__staleWhileFetching:s;if(n===undefined)continue;if(t(n,this.#l[i],this)){return this.get(this.#l[i],e)}}}forEach(t,e=this){for(const i of this.#F()){const s=this.#c[i];const n=this.#v(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#l[i],this)}}rforEach(t,e=this){for(const i of this.#A()){const s=this.#c[i];const n=this.#v(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#l[i],this)}}purgeStale(){let t=false;for(const e of this.#A({allowStale:true})){if(this.#T(e)){this.delete(this.#l[e]);t=true}}return t}dump(){const t=[];for(const e of this.#F({allowStale:true})){const s=this.#l[e];const n=this.#c[e];const h=this.#v(n)?n.__staleWhileFetching:n;if(h===undefined||s===undefined)continue;const a={value:h};if(this.#z&&this.#m){a.ttl=this.#z[e];const t=i.now()-this.#m[e];a.start=Math.floor(Date.now()-t)}if(this.#y){a.size=this.#y[e]}t.unshift([s,a])}return t}load(t){this.clear();for(const[e,s]of t){if(s.start){const t=Date.now()-s.start;s.start=i.now()-t}this.set(e,s.value,s)}}set(t,e,i={}){const{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i;let{noUpdateTTL:r=this.noUpdateTTL}=i;const l=this.#R(t,e,i.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize){if(o){o.set="miss";o.maxEntrySizeExceeded=true}this.delete(t);return this}let c=this.#a===0?undefined:this.#r.get(t);if(c===undefined){c=this.#a===0?this.#p:this.#g.length!==0?this.#g.pop():this.#a===this.#e?this.#B(false):this.#a;this.#l[c]=t;this.#c[c]=e;this.#r.set(t,c);this.#f[this.#p]=c;this.#d[c]=this.#p;this.#p=c;this.#a++;this.#W(c,l,o);if(o)o.set="add";r=false}else{this.#x(c);const i=this.#c[c];if(e!==i){if(this.#_&&this.#v(i)){i.__abortController.abort(new Error("replaced"))}else if(!h){if(this.#w){this.#s?.(i,t,"set")}if(this.#L){this.#S?.push([i,t,"set"])}}this.#C(c);this.#W(c,l,o);this.#c[c]=e;if(o){o.set="replace";const t=i&&this.#v(i)?i.__staleWhileFetching:i;if(t!==undefined)o.oldValue=t}}else if(o){o.set="update"}}if(s!==0&&!this.#z){this.#O()}if(this.#z){if(!r){this.#D(c,s,n)}if(o)this.#M(o,c)}if(!h&&this.#L&&this.#S){const t=this.#S;let e;while(e=t?.shift()){this.#n?.(...e)}}return this}pop(){try{while(this.#a){const t=this.#c[this.#u];this.#B(true);if(this.#v(t)){if(t.__staleWhileFetching){return t.__staleWhileFetching}}else if(t!==undefined){return t}}}finally{if(this.#L&&this.#S){const t=this.#S;let e;while(e=t?.shift()){this.#n?.(...e)}}}}#B(t){const e=this.#u;const i=this.#l[e];const s=this.#c[e];if(this.#_&&this.#v(s)){s.__abortController.abort(new Error("evicted"))}else if(this.#w||this.#L){if(this.#w){this.#s?.(s,i,"evict")}if(this.#L){this.#S?.push([s,i,"evict"])}}this.#C(e);if(t){this.#l[e]=undefined;this.#c[e]=undefined;this.#g.push(e)}if(this.#a===1){this.#u=this.#p=0;this.#g.length=0}else{this.#u=this.#f[e]}this.#r.delete(i);this.#a--;return e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e;const n=this.#r.get(t);if(n!==undefined){const t=this.#c[n];if(this.#v(t)&&t.__staleWhileFetching===undefined){return false}if(!this.#T(n)){if(i){this.#E(n)}if(s){s.has="hit";this.#M(s,n)}return true}else if(s){s.has="stale";this.#M(s,n)}}else if(s){s.has="miss"}return false}peek(t,e={}){const{allowStale:i=this.allowStale}=e;const s=this.#r.get(t);if(s!==undefined&&(i||!this.#T(s))){const t=this.#c[s];return this.#v(t)?t.__staleWhileFetching:t}}#k(t,e,i,s){const n=e===undefined?undefined:this.#c[e];if(this.#v(n)){return n}const h=new AbortController;const{signal:a}=i;a?.addEventListener("abort",(()=>h.abort(a.reason)),{signal:h.signal});const o={signal:h.signal,options:i,context:s};const cb=(s,n=false)=>{const{aborted:a}=h.signal;const l=i.ignoreFetchAbort&&s!==undefined;if(i.status){if(a&&!n){i.status.fetchAborted=true;i.status.fetchError=h.signal.reason;if(l)i.status.fetchAbortIgnored=true}else{i.status.fetchResolved=true}}if(a&&!l&&!n){return fetchFail(h.signal.reason)}const c=r;if(this.#c[e]===r){if(s===undefined){if(c.__staleWhileFetching){this.#c[e]=c.__staleWhileFetching}else{this.delete(t)}}else{if(i.status)i.status.fetchUpdated=true;this.set(t,s,o.options)}}return s};const eb=t=>{if(i.status){i.status.fetchRejected=true;i.status.fetchError=t}return fetchFail(t)};const fetchFail=s=>{const{aborted:n}=h.signal;const a=n&&i.allowStaleOnFetchAbort;const o=a||i.allowStaleOnFetchRejection;const l=o||i.noDeleteOnFetchRejection;const c=r;if(this.#c[e]===r){const i=!l||c.__staleWhileFetching===undefined;if(i){this.delete(t)}else if(!a){this.#c[e]=c.__staleWhileFetching}}if(o){if(i.status&&c.__staleWhileFetching!==undefined){i.status.returnedStale=true}return c.__staleWhileFetching}else if(c.__returned===c){throw s}};const pcall=(e,s)=>{const a=this.#h?.(t,n,o);if(a&&a instanceof Promise){a.then((t=>e(t)),s)}h.signal.addEventListener("abort",(()=>{if(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort){e();if(i.allowStaleOnFetchAbort){e=t=>cb(t,true)}}}))};if(i.status)i.status.fetchDispatched=true;const r=new Promise(pcall).then(cb,eb);const l=Object.assign(r,{__abortController:h,__staleWhileFetching:n,__returned:undefined});if(e===undefined){this.set(t,l,{...o.options,status:undefined});e=this.#r.get(t)}else{this.#c[e]=l}return l}#v(t){if(!this.#_)return false;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:r=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:u=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=false,status:S,signal:y}=e;if(!this.#_){if(S)S.fetch="get";return this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:S})}const m={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:a,size:o,sizeCalculation:r,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:u,ignoreFetchAbort:d,status:S,signal:y};let z=this.#r.get(t);if(z===undefined){if(S)S.fetch="miss";const e=this.#k(t,z,m,p);return e.__returned=e}else{const e=this.#c[z];if(this.#v(e)){const t=i&&e.__staleWhileFetching!==undefined;if(S){S.fetch="inflight";if(t)S.returnedStale=true}return t?e.__staleWhileFetching:e.__returned=e}const n=this.#T(z);if(!g&&!n){if(S)S.fetch="hit";this.#x(z);if(s){this.#E(z)}if(S)this.#M(S,z);return e}const h=this.#k(t,z,m,p);const a=h.__staleWhileFetching!==undefined;const o=a&&i;if(S){S.fetch=n?"stale":"refresh";if(o&&n)S.returnedStale=true}return o?h.__staleWhileFetching:h.__returned=h}}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e;const a=this.#r.get(t);if(a!==undefined){const e=this.#c[a];const o=this.#v(e);if(h)this.#M(h,a);if(this.#T(a)){if(h)h.get="stale";if(!o){if(!n){this.delete(t)}if(h&&i)h.returnedStale=true;return i?e:undefined}else{if(h&&i&&e.__staleWhileFetching!==undefined){h.returnedStale=true}return i?e.__staleWhileFetching:undefined}}else{if(h)h.get="hit";if(o){return e.__staleWhileFetching}this.#x(a);if(s){this.#E(a)}return e}}else if(h){h.get="miss"}}#U(t,e){this.#d[e]=t;this.#f[t]=e}#x(t){if(t!==this.#p){if(t===this.#u){this.#u=this.#f[t]}else{this.#U(this.#d[t],this.#f[t])}this.#U(this.#p,t);this.#p=t}}delete(t){let e=false;if(this.#a!==0){const i=this.#r.get(t);if(i!==undefined){e=true;if(this.#a===1){this.clear()}else{this.#C(i);const e=this.#c[i];if(this.#v(e)){e.__abortController.abort(new Error("deleted"))}else if(this.#w||this.#L){if(this.#w){this.#s?.(e,t,"delete")}if(this.#L){this.#S?.push([e,t,"delete"])}}this.#r.delete(t);this.#l[i]=undefined;this.#c[i]=undefined;if(i===this.#p){this.#p=this.#d[i]}else if(i===this.#u){this.#u=this.#f[i]}else{this.#f[this.#d[i]]=this.#f[i];this.#d[this.#f[i]]=this.#d[i]}this.#a--;this.#g.push(i)}}}if(this.#L&&this.#S?.length){const t=this.#S;let e;while(e=t?.shift()){this.#n?.(...e)}}return e}clear(){for(const t of this.#A({allowStale:true})){const e=this.#c[t];if(this.#v(e)){e.__abortController.abort(new Error("deleted"))}else{const i=this.#l[t];if(this.#w){this.#s?.(e,i,"delete")}if(this.#L){this.#S?.push([e,i,"delete"])}}}this.#r.clear();this.#c.fill(undefined);this.#l.fill(undefined);if(this.#z&&this.#m){this.#z.fill(0);this.#m.fill(0)}if(this.#y){this.#y.fill(0)}this.#u=0;this.#p=0;this.#g.length=0;this.#o=0;this.#a=0;if(this.#L&&this.#S){const t=this.#S;let e;while(e=t?.shift()){this.#n?.(...e)}}}}e.LRUCache=LRUCache;e["default"]=LRUCache}};var e={};function __nccwpck_require__(i){var s=e[i];if(s!==undefined){return s.exports}var n=e[i]={exports:{}};var h=true;try{t[i].call(n.exports,n,n.exports,__nccwpck_require__);h=false}finally{if(h)delete e[i]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(914);module.exports=i})();
|