@dillonkearns/elm-graphql
Version:
<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">
31 lines (21 loc) • 737 B
JavaScript
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
var _this$1 = undefined;
/**
* Returns true if given index is the last one or false otherwise.
*/
var isLastIndex = function (array, index) {
_newArrowCheck(this, _this$1);
return index === array.length - 1;
}.bind(undefined);
var isLastIndex$1 = curry(isLastIndex);
var _this = undefined;
/**
* Returns 0 if current index is the last one, or returns next if it is not.
*/
var cycleNext = function (array, currentIndex) {
_newArrowCheck(this, _this);
return isLastIndex$1(array, currentIndex) ? 0 : currentIndex + 1;
}.bind(undefined);
var cycleNext$1 = curry(cycleNext);
export default cycleNext$1;