UNPKG

@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">

44 lines (31 loc) 1.36 kB
'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys')); var _objectWithoutProperties = _interopDefault(require('babel-runtime/helpers/objectWithoutProperties')); var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck')); var _Number$isInteger = _interopDefault(require('babel-runtime/core-js/number/is-integer')); var _this$1 = undefined; var isIntGreaterThan = function (number, other) { _newArrowCheck(this, _this$1); return _Number$isInteger(number) && number >= other; }.bind(undefined); /** * Returns true if the given string is an Array key or false otherwise. */ var isKey = function (string) { _newArrowCheck(this, _this$1); return isIntGreaterThan(Number(string), 0); }.bind(undefined); var _this = undefined; /** * Returns true if an Array can be created from the given Object, or in other * words, if it has or not a length property, and the rest of its keys are Array * ones. */ var isPossibleFromObject = function (_ref) { var length = _ref.length, rest = _objectWithoutProperties(_ref, ["length"]); _newArrowCheck(this, _this); return _Object$keys(rest).every(isKey); }.bind(undefined); module.exports = isPossibleFromObject;