Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Cycle

import { Cycle } from "https://raw.githubusercontent.com/EthanThatOneKid/pomo/main/cycle.ts";

A Cycle is an array of numbers that repeat indefinitely.

class Cycle {
constructor(periods: number[]);
public readonly data: number[];
public readonly total: number;
 
public at(n: number): number;
public next(i: number, count?): number;
}

§Constructors

§
new Cycle(periods: number[])
[src]

§Properties

§
data: number[]
[src]
§
total: number
[src]

§Methods

§
at(n: number): number
[src]

Given a number, return the index of the period that contains that time inclusive of the start of the period and exclusive of the end of the period (i.e. the period is [start, end)).

This method uses a Binary Search algorithm.