cronstrue 3.43.0 → 3.44.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.
@@ -130,6 +130,12 @@ var CronParser = (function () {
130
130
  if (expressionParts[6].indexOf("1/") == 0) {
131
131
  expressionParts[6] = expressionParts[6].replace("1/", "*/");
132
132
  }
133
+ if (this.dayOfWeekStartIndexZero) {
134
+ expressionParts[5] = expressionParts[5]
135
+ .split(",")
136
+ .map(function (item) { return item.replace(/^0-7(?=\/|$)/, "0-6"); })
137
+ .join(",");
138
+ }
133
139
  expressionParts[5] = expressionParts[5].replace(/(^\d+)|([^#/\s\d]\d+)/g, function (t) {
134
140
  var dowDigits = t.replace(/\D/, "");
135
141
  var dowDigitsAdjusted = dowDigits;
@@ -168,6 +174,10 @@ var CronParser = (function () {
168
174
  for (var day in days) {
169
175
  expressionParts[5] = expressionParts[5].replace(new RegExp(day, "gi"), days[day].toString());
170
176
  }
177
+ expressionParts[5] = expressionParts[5]
178
+ .split(",")
179
+ .filter(function (item, index, items) { return item === "" || items.indexOf(item) === index; })
180
+ .join(",");
171
181
  expressionParts[4] = expressionParts[4].replace(/(^\d{1,2})|([^#/\s\d]\d{1,2})/g, function (t) {
172
182
  var dowDigits = t.replace(/\D/, "");
173
183
  var dowDigitsAdjusted = dowDigits;