@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">
35 lines (23 loc) • 895 B
JavaScript
;
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('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 = Fun.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 = Fun.curry(cycleNext);
module.exports = cycleNext$1;