cronstrue 2.52.0 → 2.53.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.
@@ -8,6 +8,6 @@ export declare class CronParser {
8
8
  protected extractParts(expression: string): string[];
9
9
  protected normalize(expressionParts: string[]): void;
10
10
  protected validate(parsed: string[]): void;
11
- protected validateRange(parsed: string[]): void;
12
- protected assertNoInvalidCharacters(partDescription: string, expression: string): void;
11
+ protected validateAnyRanges(parsed: string[]): void;
12
+ protected validateOnlyExpectedCharactersFound(cronPart: string, allowedCharsExpression: string): void;
13
13
  }
@@ -224,11 +224,17 @@ var CronParser = (function () {
224
224
  }
225
225
  };
226
226
  CronParser.prototype.validate = function (parsed) {
227
- this.assertNoInvalidCharacters("DOW", parsed[5]);
228
- this.assertNoInvalidCharacters("DOM", parsed[3]);
229
- this.validateRange(parsed);
230
- };
231
- CronParser.prototype.validateRange = function (parsed) {
227
+ var standardCronPartCharacters = "0-9,\\-*\/";
228
+ this.validateOnlyExpectedCharactersFound(parsed[0], standardCronPartCharacters);
229
+ this.validateOnlyExpectedCharactersFound(parsed[1], standardCronPartCharacters);
230
+ this.validateOnlyExpectedCharactersFound(parsed[2], standardCronPartCharacters);
231
+ this.validateOnlyExpectedCharactersFound(parsed[3], "0-9,\\-*\/LW");
232
+ this.validateOnlyExpectedCharactersFound(parsed[4], standardCronPartCharacters);
233
+ this.validateOnlyExpectedCharactersFound(parsed[5], "0-9,\\-*\/L#");
234
+ this.validateOnlyExpectedCharactersFound(parsed[6], standardCronPartCharacters);
235
+ this.validateAnyRanges(parsed);
236
+ };
237
+ CronParser.prototype.validateAnyRanges = function (parsed) {
232
238
  rangeValidator_1.default.secondRange(parsed[0]);
233
239
  rangeValidator_1.default.minuteRange(parsed[1]);
234
240
  rangeValidator_1.default.hourRange(parsed[2]);
@@ -236,10 +242,10 @@ var CronParser = (function () {
236
242
  rangeValidator_1.default.monthRange(parsed[4], this.monthStartIndexZero);
237
243
  rangeValidator_1.default.dayOfWeekRange(parsed[5], this.dayOfWeekStartIndexZero);
238
244
  };
239
- CronParser.prototype.assertNoInvalidCharacters = function (partDescription, expression) {
240
- var invalidChars = expression.match(/[A-KM-VX-Z]+/gi);
245
+ CronParser.prototype.validateOnlyExpectedCharactersFound = function (cronPart, allowedCharsExpression) {
246
+ var invalidChars = cronPart.match(new RegExp("[^".concat(allowedCharsExpression, "]+"), "gi"));
241
247
  if (invalidChars && invalidChars.length) {
242
- throw new Error("".concat(partDescription, " part contains invalid values: '").concat(invalidChars.toString(), "'"));
248
+ throw new Error("Expression contains invalid values: '".concat(invalidChars.toString(), "'"));
243
249
  }
244
250
  };
245
251
  return CronParser;
@@ -7471,19 +7477,19 @@ var zh_CN = (function () {
7471
7477
  return "每隔 %s 秒";
7472
7478
  };
7473
7479
  zh_CN.prototype.secondsX0ThroughX1PastTheMinute = function () {
7474
- return "在每分钟的第 %s 到 %s 秒";
7480
+ return "在一分钟后的第 %s 到 %s 秒";
7475
7481
  };
7476
7482
  zh_CN.prototype.atX0SecondsPastTheMinute = function () {
7477
- return "在每分钟的第 %s 秒";
7483
+ return "在一分钟后的第 %s 秒";
7478
7484
  };
7479
7485
  zh_CN.prototype.everyX0Minutes = function () {
7480
7486
  return "每隔 %s 分钟";
7481
7487
  };
7482
7488
  zh_CN.prototype.minutesX0ThroughX1PastTheHour = function () {
7483
- return "在每小时的第 %s 到 %s 分钟";
7489
+ return "在整点后的第 %s 到 %s 分钟";
7484
7490
  };
7485
7491
  zh_CN.prototype.atX0MinutesPastTheHour = function () {
7486
- return "在每小时的第 %s 分钟";
7492
+ return "在整点后的第 %s 分钟";
7487
7493
  };
7488
7494
  zh_CN.prototype.everyX0Hours = function () {
7489
7495
  return "每隔 %s 小时";
@@ -7652,19 +7658,19 @@ var zh_TW = (function () {
7652
7658
  return "每 %s 秒";
7653
7659
  };
7654
7660
  zh_TW.prototype.secondsX0ThroughX1PastTheMinute = function () {
7655
- return "在每分鐘的 %s 到 %s 秒";
7661
+ return "在一分鐘後的 %s 到 %s 秒";
7656
7662
  };
7657
7663
  zh_TW.prototype.atX0SecondsPastTheMinute = function () {
7658
- return "在每分鐘的 %s 秒";
7664
+ return "在一分鐘後的 %s 秒";
7659
7665
  };
7660
7666
  zh_TW.prototype.everyX0Minutes = function () {
7661
7667
  return "每 %s 分鐘";
7662
7668
  };
7663
7669
  zh_TW.prototype.minutesX0ThroughX1PastTheHour = function () {
7664
- return "在每小時的 %s 到 %s 分鐘";
7670
+ return "在整點後的 %s 到 %s 分鐘";
7665
7671
  };
7666
7672
  zh_TW.prototype.atX0MinutesPastTheHour = function () {
7667
- return "在每小時的 %s 分";
7673
+ return "在整點後的 %s 分";
7668
7674
  };
7669
7675
  zh_TW.prototype.everyX0Hours = function () {
7670
7676
  return "每 %s 小時";