UNPKG

data-fns

Version:

This library provides utility functions for working with array data that are useful in many contexts, including creative coding. It offers generic functions that perform common operations such as offsetting an array, generating an array based on a callbac

11 lines (10 loc) 305 B
/** * Maps an index to a cyclic pattern. * @param index The original index. * @param length The length of the sequence. * @returns The mapped index in the cyclic pattern. * @example * cyclic(6, 5) * // Returns 1 */ export declare const cyclic: (index: number, length: number) => number;