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) 2.89 kB
import _newArrowCheck from"babel-runtime/helpers/newArrowCheck";import{curry}from"flow-static-land/lib/Fun";import _Symbol from"babel-runtime/core-js/symbol";import _extends from"babel-runtime/helpers/extends";import{isLastIndex,remove}from"@jumpn/utils-array";import _objectWithoutProperties from"babel-runtime/helpers/objectWithoutProperties";import _toConsumableArray from"babel-runtime/helpers/toConsumableArray";var _this$2=void 0,get=function(e,r){return _newArrowCheck(this,_this$2),r[e]}.bind(void 0),get$1=curry(get),_this$3=void 0,hasKey=function(e,r){return _newArrowCheck(this,_this$3),Object.prototype.hasOwnProperty.call(r,e)}.bind(void 0),hasKey$1=curry(hasKey),_this$4=void 0,objectRemove=function(e,r){r[e];var t=_objectWithoutProperties(r,[e]);return _newArrowCheck(this,_this$4),t}.bind(void 0),remove$1=function(e,r){return _newArrowCheck(this,_this$4),Array.isArray(r)?remove(e,1,r):objectRemove(e,r)}.bind(void 0),remove$2=curry(remove$1),_this$5=void 0,shallowCopy=function(e){return _newArrowCheck(this,_this$5),Array.isArray(e)?[].concat(_toConsumableArray(e)):_extends({},e)}.bind(void 0),_this$1=void 0,createReduceContext=function(e){_newArrowCheck(this,_this$1);var r=shallowCopy(e);return{origin:r,previous:void 0,current:r}}.bind(void 0),createSupporting=function(e){return _newArrowCheck(this,_this$1),"number"==typeof e?[]:{}}.bind(void 0),copyOrCreate=function(e,r,t){return _newArrowCheck(this,_this$1),hasKey$1(e,t)?shallowCopy(get$1(e,t)):createSupporting(r)}.bind(void 0),getNext=function(e,r,t,i){return _newArrowCheck(this,_this$1),isLastIndex(e,t)?r(get$1(e[t],i)):copyOrCreate(e[t],e[t+1],i)}.bind(void 0),set=function(e,r,t){return _newArrowCheck(this,_this$1),t[e]=r,get$1(e,t)}.bind(void 0),updateSet=function(e,r,t,i){return _newArrowCheck(this,_this$1),_extends({},i,{current:set(e[r],t,i.current)})}.bind(void 0),updateRemove=function(e,r,t){_newArrowCheck(this,_this$1);var i=remove$2(e[r],t.current);return 0===r?_extends({},t,{current:i,origin:i}):_extends({},t,{previous:set(e[r-1],i,t.previous)})}.bind(void 0),removeAction=_Symbol("composite.updateIn.removeAction"),update=function(e,r,t,i){return _newArrowCheck(this,_this$1),t===removeAction?updateRemove(e,r,i):updateSet(e,r,t,i)}.bind(void 0),getReducer=function(e,r){return _newArrowCheck(this,_this$1),function(t,i,n){return _newArrowCheck(this,_this$1),update(e,n,getNext(e,r,n,t.current),t)}.bind(this)}.bind(void 0),updateIn=function(e,r,t){return _newArrowCheck(this,_this$1),0===e.length?t:e.reduce(getReducer(e,r),createReduceContext(t)).origin}.bind(void 0),updateInCurried=curry(updateIn);updateInCurried.remove=removeAction;var _this=void 0,setIn=function(e,r,t){return _newArrowCheck(this,_this),updateInCurried(e,function(){return _newArrowCheck(this,_this),r}.bind(this),t)}.bind(void 0),setIn$1=curry(setIn);export default setIn$1; //# sourceMappingURL=setIn.js.map