UNPKG

solidity-cron

Version:

[![Build Status](https://travis-ci.com/Frontier-project/cron.svg?token=DJeMzxJJncp3nRaEUuxH&branch=master)](https://travis-ci.com/Frontier-project/cron) [![codecov](https://codecov.io/gh/Frontier-project/cron/branch/master/graph/badge.svg?token=BGbU5Q6IRV

14 lines (13 loc) 385 B
module.exports = { stagesFromBounds: async function (periodicStages, bounds) { for (let i = 0; i < bounds.length; i++) { if (i == 0) { await periodicStages.pushStage(bounds[i]) } else if (bounds[i] != 0 && bounds[i] > bounds[i - 1]) { await periodicStages.pushStage(bounds[i] - (bounds[i] - 1)) } else { return false } } } }