node-red-contrib-cron-plus
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -54,2 +54,11 @@ const parser = require('cronstrue'); | ||
} | ||
function isCronLike(expression){ | ||
if(expression.includes("*")){ | ||
return true; | ||
} | ||
let cleaned = expression.replace(/\s\s+/g, ' '); | ||
let spaces = cleaned.split(" "); | ||
return spaces.length >= 4 && spaces.length <= 6 ; | ||
} | ||
function parseDateSequence(expression){ | ||
@@ -60,2 +69,8 @@ let result = {isDateSequence: false, expression: expression}; | ||
let spl = expression.split(","); | ||
for (let index = 0; index < spl.length; index++) { | ||
spl[index] = spl[index].trim(); | ||
if(isCronLike(spl[index])){ | ||
return result;//fail | ||
} | ||
} | ||
dates = spl.map(x => { | ||
@@ -65,3 +80,4 @@ if(isNumber(x)){ | ||
} | ||
return new Date(x); | ||
let d = new Date(x); | ||
return d; | ||
}) | ||
@@ -68,0 +84,0 @@ } |
{ | ||
"name": "node-red-contrib-cron-plus", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "A flexible scheduler node for Node-RED (incl dynamic control and Timezone support)", | ||
@@ -5,0 +5,0 @@ "main": "cronplus.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108142
1032