Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
27
node_modules/node-cron/src/convert-expression/step-values-conversion.js
generated
vendored
Normal file
27
node_modules/node-cron/src/convert-expression/step-values-conversion.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (() => {
|
||||
function convertSteps(expressions){
|
||||
var stepValuePattern = /^(.+)\/(\d+)$/;
|
||||
for(var i = 0; i < expressions.length; i++){
|
||||
var match = stepValuePattern.exec(expressions[i]);
|
||||
var isStepValue = match !== null && match.length > 0;
|
||||
if(isStepValue){
|
||||
var values = match[1].split(',');
|
||||
var setpValues = [];
|
||||
var divider = parseInt(match[2], 10);
|
||||
for(var j = 0; j <= values.length; j++){
|
||||
var value = parseInt(values[j], 10);
|
||||
if(value % divider === 0){
|
||||
setpValues.push(value);
|
||||
}
|
||||
}
|
||||
expressions[i] = setpValues.join(',');
|
||||
}
|
||||
}
|
||||
return expressions;
|
||||
}
|
||||
|
||||
return convertSteps;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user