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

3 lines (2 loc) 5.85 kB
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _newArrowCheck=_interopDefault(require("babel-runtime/helpers/newArrowCheck")),Fun=require("flow-static-land/lib/Fun"),utilsArray=require("@jumpn/utils-array"),_Object$keys=_interopDefault(require("babel-runtime/core-js/object/keys")),_toConsumableArray=_interopDefault(require("babel-runtime/helpers/toConsumableArray")),isDeepEqual=_interopDefault(require("fast-deep-equal")),_defineProperty=_interopDefault(require("babel-runtime/helpers/defineProperty")),_extends=_interopDefault(require("babel-runtime/helpers/extends")),_slicedToArray=_interopDefault(require("babel-runtime/helpers/slicedToArray")),_Object$entries=_interopDefault(require("babel-runtime/core-js/object/entries")),_objectWithoutProperties=_interopDefault(require("babel-runtime/helpers/objectWithoutProperties")),_Symbol=_interopDefault(require("babel-runtime/core-js/symbol")),_this=void 0,get=function(e,r){return _newArrowCheck(this,_this),r[e]}.bind(void 0),get$1=Fun.curry(get),_this$2=void 0,hasKey=function(e,r){return _newArrowCheck(this,_this$2),Object.prototype.hasOwnProperty.call(r,e)}.bind(void 0),hasKey$1=Fun.curry(hasKey),_this$1=void 0,getInRecur=function(e,r,t){return _newArrowCheck(this,_this$1),utilsArray.isLastIndex(r,e)?get$1(r[e],t):hasKey$1(r[e],t)?getInRecur(e+1,r,get$1(r[e],t)):void 0}.bind(void 0),getIn=function(e,r){return _newArrowCheck(this,_this$1),0===e.length?void 0:getInRecur(0,e,r)}.bind(void 0),getIn$1=Fun.curry(getIn),_this$3=void 0,getKeys=function(e){return _newArrowCheck(this,_this$3),Array.isArray(e)?[].concat(_toConsumableArray(e.keys())):_Object$keys(e)}.bind(void 0),_this$4=void 0,hasIn=function(e,r,t){return _newArrowCheck(this,_this$4),isDeepEqual(getIn$1(e,t),r)}.bind(void 0),hasIn$1=Fun.curry(hasIn),_this$5=void 0,haveSameProps=function(e,r){_newArrowCheck(this,_this$5);var t=getKeys(e);return t.length===getKeys(r).length&&t.every(function(t){return _newArrowCheck(this,_this$5),hasKey$1(t,r)&&get$1(t,e)===get$1(t,r)}.bind(this))}.bind(void 0),haveSameProps$1=Fun.curry(haveSameProps),_this$6=void 0,mapObject=function(e,r){return _newArrowCheck(this,_this$6),_Object$entries(r).reduce(function(t,n){var i=_slicedToArray(n,2),o=i[0],s=i[1];return _newArrowCheck(this,_this$6),_extends({},t,_defineProperty({},o,e(s,o,r)))}.bind(this),{})}.bind(void 0),map=function(e,r){return _newArrowCheck(this,_this$6),Array.isArray(r)?r.map(e):mapObject(e,r)}.bind(void 0),map$1=Fun.curry(map),_this$7=void 0,objectRemove=function(e,r){r[e];var t=_objectWithoutProperties(r,[e]);return _newArrowCheck(this,_this$7),t}.bind(void 0),remove$1=function(e,r){return _newArrowCheck(this,_this$7),Array.isArray(r)?utilsArray.remove(e,1,r):objectRemove(e,r)}.bind(void 0),remove$2=Fun.curry(remove$1),_this$10=void 0,shallowCopy=function(e){return _newArrowCheck(this,_this$10),Array.isArray(e)?[].concat(_toConsumableArray(e)):_extends({},e)}.bind(void 0),_this$9=void 0,createReduceContext=function(e){_newArrowCheck(this,_this$9);var r=shallowCopy(e);return{origin:r,previous:void 0,current:r}}.bind(void 0),createSupporting=function(e){return _newArrowCheck(this,_this$9),"number"==typeof e?[]:{}}.bind(void 0),copyOrCreate=function(e,r,t){return _newArrowCheck(this,_this$9),hasKey$1(e,t)?shallowCopy(get$1(e,t)):createSupporting(r)}.bind(void 0),getNext=function(e,r,t,n){return _newArrowCheck(this,_this$9),utilsArray.isLastIndex(e,t)?r(get$1(e[t],n)):copyOrCreate(e[t],e[t+1],n)}.bind(void 0),set=function(e,r,t){return _newArrowCheck(this,_this$9),t[e]=r,get$1(e,t)}.bind(void 0),updateSet=function(e,r,t,n){return _newArrowCheck(this,_this$9),_extends({},n,{current:set(e[r],t,n.current)})}.bind(void 0),updateRemove=function(e,r,t){_newArrowCheck(this,_this$9);var n=remove$2(e[r],t.current);return 0===r?_extends({},t,{current:n,origin:n}):_extends({},t,{previous:set(e[r-1],n,t.previous)})}.bind(void 0),removeAction=_Symbol("composite.updateIn.removeAction"),update=function(e,r,t,n){return _newArrowCheck(this,_this$9),t===removeAction?updateRemove(e,r,n):updateSet(e,r,t,n)}.bind(void 0),getReducer=function(e,r){return _newArrowCheck(this,_this$9),function(t,n,i){return _newArrowCheck(this,_this$9),update(e,i,getNext(e,r,i,t.current),t)}.bind(this)}.bind(void 0),updateIn=function(e,r,t){return _newArrowCheck(this,_this$9),0===e.length?t:e.reduce(getReducer(e,r),createReduceContext(t)).origin}.bind(void 0),updateInCurried=Fun.curry(updateIn);updateInCurried.remove=removeAction;var _this$8=void 0,remove$3=function(){return _newArrowCheck(this,_this$8),updateInCurried.remove}.bind(void 0),removeIn=function(e,r){return _newArrowCheck(this,_this$8),updateInCurried(e,remove$3,r)}.bind(void 0),removeIn$1=Fun.curry(removeIn),_this$11=void 0,set$1=function(e,r,t){_newArrowCheck(this,_this$11);var n=shallowCopy(t);return n[e]=r,n}.bind(void 0),set$2=Fun.curry(set$1),_this$12=void 0,setIn=function(e,r,t){return _newArrowCheck(this,_this$12),updateInCurried(e,function(){return _newArrowCheck(this,_this$12),r}.bind(this),t)}.bind(void 0),setIn$1=Fun.curry(setIn),_this$13=void 0,xor=function(e,r){return _newArrowCheck(this,_this$13),Boolean(Number(e)^Number(r))}.bind(void 0),shallowEqual=function(e,r){return _newArrowCheck(this,_this$13),e===r||!xor(Array.isArray(e),Array.isArray(r))&&haveSameProps$1(e,r)}.bind(void 0),shallowEqual$1=Fun.curry(shallowEqual);exports.get=get$1,exports.getIn=getIn$1,exports.getKeys=getKeys,exports.hasIn=hasIn$1,exports.hasKey=hasKey$1,exports.haveSameProps=haveSameProps$1,exports.map=map$1,exports.remove=remove$2,exports.removeIn=removeIn$1,exports.set=set$2,exports.setIn=setIn$1,exports.shallowCopy=shallowCopy,exports.shallowEqual=shallowEqual$1,exports.updateIn=updateInCurried; //# sourceMappingURL=index.js.map