Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@6degrees/node-cron-utils

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@6degrees/node-cron-utils - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

16

main.js

@@ -32,3 +32,9 @@ class utils {

}
new_expression["seconds"] = `${step}/${doubledRange}`;
if(add_to_minutes){
new_expression["seconds"] = `${doubledRange}`;
}
else{
new_expression["seconds"] = `${step}/${doubledRange}`;
}
}

@@ -40,3 +46,9 @@ else if(expression["seconds"] == "*"){ // *

else{ // 5
let range = expression["seconds"];
let doubledRange = parseInt(range) * 2;
if(doubledRange >= 60){
add_to_minutes = Math.floor(doubledRange / 60);
doubledRange = doubledRange % 60;
}
new_expression["seconds"] = `${doubledRange}`;
}

@@ -43,0 +55,0 @@

{
"name": "@6degrees/node-cron-utils",
"version": "0.0.2",
"version": "0.0.3",
"description": "Utilities functions to manipulate node-cron expressions",

@@ -19,2 +19,6 @@ "main": "main.js",

],
"publishConfig": {
"access": "public"
},
"private": false,
"author": "Mohannad F. Otaibi",

@@ -21,0 +25,0 @@ "license": "ISC",

14

test/test.js

@@ -25,16 +25,16 @@

test('testing */40 * * * * *', ()=>{
expect(hi.double("*/40 * * * * *")).toBe("*/20 */1 * * * *")
expect(hi.double("*/40 * * * * *")).toBe("20 */1 * * * *")
})
test('testing */20 */1 * * * *', ()=>{
expect(hi.double("*/20 */1 * * * *")).toBe("*/40 */2 * * * *")
test('testing 20 */1 * * * *', ()=>{
expect(hi.double("20 */1 * * * *")).toBe("40 */2 * * * *")
})
test('testing */40 */1 * * * *', ()=>{
expect(hi.double("*/40 */1 * * * *")).toBe("*/20 */3 * * * *")
test('testing 40 */1 * * * *', ()=>{
expect(hi.double("40 */1 * * * *")).toBe("20 */3 * * * *")
})
test('testing */40 */40 * * * *', ()=>{
expect(hi.double("*/40 */40 * * * *")).toBe("*/20 */21 * * * *") // Not sure if this is correct
test('testing 40 */40 * * * *', ()=>{
expect(hi.double("40 */40 * * * *")).toBe("20 */21 * * * *") // Not sure if this is correct
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc