Socket
Socket
Sign inDemoInstall

inaction

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inaction - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

src/splice.js

15

dist/index.cjs.js

@@ -115,4 +115,2 @@ 'use strict';

//
// This will shallow clone only the objects in the path that changed.
//
// See: https://github.com/lodash/lodash/issues/1696#issuecomment-328335502

@@ -124,2 +122,14 @@ //

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
// Update @state by splicing in a @value at @index in the array at @path.
//
// A new array is created if the current value of @path is undefined.
//
var splice = function splice(state, path, index, value) {
var prev = get(state, path, []);
var next = [].concat(_toConsumableArray(prev.slice(0, index)), [value], _toConsumableArray(prev.slice(index)));
return set$1(state, path, next);
};
exports.action = action;

@@ -130,1 +140,2 @@ exports.bindStateSelectors = bindStateSelectors;

exports.set = set$1;
exports.splice = splice;

@@ -109,4 +109,2 @@ import { bindActionCreators } from 'redux';

//
// This will shallow clone only the objects in the path that changed.
//
// See: https://github.com/lodash/lodash/issues/1696#issuecomment-328335502

@@ -118,2 +116,14 @@ //

export { action, bindStateSelectors, connect$1 as connect, push, set$1 as set };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
// Update @state by splicing in a @value at @index in the array at @path.
//
// A new array is created if the current value of @path is undefined.
//
var splice = function splice(state, path, index, value) {
var prev = get(state, path, []);
var next = [].concat(_toConsumableArray(prev.slice(0, index)), [value], _toConsumableArray(prev.slice(index)));
return set$1(state, path, next);
};
export { action, bindStateSelectors, connect$1 as connect, push, set$1 as set, splice };

2

dist/index.umd.js

@@ -1,1 +0,1 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("redux"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","redux","react-redux"],r):r(t.inaction={},t.redux,t.reactRedux)}(this,function(t,n,r){"use strict";var o=function(r,e){var n={};return Object.keys(r).forEach(function(t){n[t]=e(r[t])}),n},a=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];return o(t,function(t){return t.bind(null,r)})},e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,r){return t(r={exports:{}},r.exports),r.exports}var c="object"==typeof e&&e&&e.Object===Object&&e,i="object"==typeof self&&self&&self.Object===Object&&self,f=c||i||Function("return this")(),s=f.Symbol,v=Object.prototype,l=v.hasOwnProperty,p=v.toString,b=s?s.toStringTag:void 0;var y=function(t){var r=l.call(t,b),e=t[b];try{t[b]=void 0}catch(t){}var n=p.call(t);return r?t[b]=e:delete t[b],n},h=Object.prototype.toString;var j=function(t){return h.call(t)},d=s?s.toStringTag:void 0;var _=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":d&&d in Object(t)?y(t):j(t)};var g=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)};var w,O=function(t){if(!g(t))return!1;var r=_(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},A=f["__core-js_shared__"],m=(w=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var x=function(t){return!!m&&m in t},S=Function.prototype.toString;var P=function(t){if(null!=t){try{return S.call(t)}catch(t){}try{return t+""}catch(t){}}return""},z=/^\[object .+?Constructor\]$/,F=Function.prototype,I=Object.prototype,U=F.toString,E=I.hasOwnProperty,M=RegExp("^"+U.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(t){return!(!g(t)||x(t))&&(O(t)?M:z).test(P(t))};var T=function(t,r){return null==t?void 0:t[r]};var $=function(t,r){var e=T(t,r);return k(e)?e:void 0},B=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var C=function(t,r,e){"__proto__"==r&&B?B(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var D=function(t,r){return t===r||t!=t&&r!=r},R=Object.prototype.hasOwnProperty;var V=function(t,r,e){var n=t[r];R.call(t,r)&&D(n,e)&&(void 0!==e||r in t)||C(t,r,e)},q=Array.isArray;var N=function(t){return null!=t&&"object"==typeof t};var W=function(t){return"symbol"==typeof t||N(t)&&"[object Symbol]"==_(t)},L=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var H=function(t,r){if(q(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!W(t))||G.test(t)||!L.test(t)||null!=r&&t in Object(r)},J=$(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var Q=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},X=Object.prototype.hasOwnProperty;var Y=function(t){var r=this.__data__;if(J){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return X.call(r,t)?r[t]:void 0},Z=Object.prototype.hasOwnProperty;var tt=function(t){var r=this.__data__;return J?void 0!==r[t]:Z.call(r,t)};var rt=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=J&&void 0===r?"__lodash_hash_undefined__":r,this};function et(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}et.prototype.clear=K,et.prototype.delete=Q,et.prototype.get=Y,et.prototype.has=tt,et.prototype.set=rt;var nt=et;var ot=function(){this.__data__=[],this.size=0};var at=function(t,r){for(var e=t.length;e--;)if(D(t[e][0],r))return e;return-1},ut=Array.prototype.splice;var ct=function(t){var r=this.__data__,e=at(r,t);return!(e<0||(e==r.length-1?r.pop():ut.call(r,e,1),--this.size,0))};var it=function(t){var r=this.__data__,e=at(r,t);return e<0?void 0:r[e][1]};var ft=function(t){return-1<at(this.__data__,t)};var st=function(t,r){var e=this.__data__,n=at(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function vt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}vt.prototype.clear=ot,vt.prototype.delete=ct,vt.prototype.get=it,vt.prototype.has=ft,vt.prototype.set=st;var lt=vt,pt=$(f,"Map");var bt=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var yt=function(t,r){var e=t.__data__;return bt(r)?e["string"==typeof r?"string":"hash"]:e.map};var ht=function(t){var r=yt(this,t).delete(t);return this.size-=r?1:0,r};var jt=function(t){return yt(this,t).get(t)};var dt=function(t){return yt(this,t).has(t)};var _t=function(t,r){var e=yt(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function gt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}gt.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(pt||lt),string:new nt}},gt.prototype.delete=ht,gt.prototype.get=jt,gt.prototype.has=dt,gt.prototype.set=_t;var wt=gt,Ot="Expected a function";function At(o,a){if("function"!=typeof o||null!=a&&"function"!=typeof a)throw new TypeError(Ot);var u=function(){var t=arguments,r=a?a.apply(this,t):t[0],e=u.cache;if(e.has(r))return e.get(r);var n=o.apply(this,t);return u.cache=e.set(r,n)||e,n};return u.cache=new(At.Cache||wt),u}At.Cache=wt;var mt=At;var xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/\\(\\)?/g,Pt=function(t){var r=mt(t,function(t){return 500===e.size&&e.clear(),t}),e=r.cache;return r}(function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(xt,function(t,r,e,n){o.push(e?n.replace(St,"$1"):r||t)}),o});var zt=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o},Ft=1/0,It=s?s.prototype:void 0,Ut=It?It.toString:void 0;var Et=function t(r){if("string"==typeof r)return r;if(q(r))return zt(r,t)+"";if(W(r))return Ut?Ut.call(r):"";var e=r+"";return"0"==e&&1/r==-Ft?"-0":e};var Mt=function(t){return null==t?"":Et(t)};var kt=function(t,r){return q(t)?t:H(t,r)?[t]:Pt(Mt(t))},Tt=/^(?:0|[1-9]\d*)$/;var $t=function(t,r){var e=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&Tt.test(t))&&-1<t&&t%1==0&&t<r};var Bt=function(t){if("string"==typeof t||W(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r};var Ct=function(t,r,e,n){if(!g(t))return t;for(var o=-1,a=(r=kt(r,t)).length,u=a-1,c=t;null!=c&&++o<a;){var i=Bt(r[o]),f=e;if(o!=u){var s=c[i];void 0===(f=n?n(s,i,c):void 0)&&(f=g(s)?s:$t(r[o+1])?[]:{})}V(c,i,f),c=c[i]}return t};var Dt=function(t,r,e){return null==t?t:Ct(t,r,e)};var Rt=function(t,r){for(var e=0,n=(r=kt(r,t)).length;null!=t&&e<n;)t=t[Bt(r[e++])];return e&&e==n?t:void 0};var Vt=function(t,r,e){var n=null==t?void 0:Rt(t,r);return void 0===n?e:n};var qt=function(t,r,e,n){return n="function"==typeof n?n:void 0,null==t?t:Ct(t,r,e,n)};var Nt=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var Wt=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)};var Gt=function(t,r){var e=this.__data__;if(e instanceof lt){var n=e.__data__;if(!pt||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new wt(n)}return e.set(t,r),this.size=e.size,this};function Ht(t){var r=this.__data__=new lt(t);this.size=r.size}Ht.prototype.clear=function(){this.__data__=new lt,this.size=0},Ht.prototype.delete=Nt,Ht.prototype.get=Wt,Ht.prototype.has=Lt,Ht.prototype.set=Gt;var Jt=Ht;var Kt=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n&&!1!==r(t[e],e,t););return t};var Qt=function(t,r,e,n){var o=!e;e||(e={});for(var a=-1,u=r.length;++a<u;){var c=r[a],i=n?n(e[c],t[c],c,e,t):void 0;void 0===i&&(i=t[c]),o?C(e,c,i):V(e,c,i)}return e};var Xt=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n};var Yt=function(t){return N(t)&&"[object Arguments]"==_(t)},Zt=Object.prototype,tr=Zt.hasOwnProperty,rr=Zt.propertyIsEnumerable,er=Yt(function(){return arguments}())?Yt:function(t){return N(t)&&tr.call(t,"callee")&&!rr.call(t,"callee")};var nr=function(){return!1},or=u(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=(o?o.isBuffer:void 0)||nr;t.exports=a});var ar=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},ur={};ur["[object Float32Array]"]=ur["[object Float64Array]"]=ur["[object Int8Array]"]=ur["[object Int16Array]"]=ur["[object Int32Array]"]=ur["[object Uint8Array]"]=ur["[object Uint8ClampedArray]"]=ur["[object Uint16Array]"]=ur["[object Uint32Array]"]=!0,ur["[object Arguments]"]=ur["[object Array]"]=ur["[object ArrayBuffer]"]=ur["[object Boolean]"]=ur["[object DataView]"]=ur["[object Date]"]=ur["[object Error]"]=ur["[object Function]"]=ur["[object Map]"]=ur["[object Number]"]=ur["[object Object]"]=ur["[object RegExp]"]=ur["[object Set]"]=ur["[object String]"]=ur["[object WeakMap]"]=!1;var cr=function(t){return N(t)&&ar(t.length)&&!!ur[_(t)]};var ir=function(r){return function(t){return r(t)}},fr=u(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&c.process,a=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),sr=fr&&fr.isTypedArray,vr=sr?ir(sr):cr,lr=Object.prototype.hasOwnProperty;var pr=function(t,r){var e=q(t),n=!e&&er(t),o=!e&&!n&&or(t),a=!e&&!n&&!o&&vr(t),u=e||n||o||a,c=u?Xt(t.length,String):[],i=c.length;for(var f in t)!r&&!lr.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||$t(f,i))||c.push(f);return c},br=Object.prototype;var yr=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||br)};var hr=function(r,e){return function(t){return r(e(t))}},jr=hr(Object.keys,Object),dr=Object.prototype.hasOwnProperty;var _r=function(t){if(!yr(t))return jr(t);var r=[];for(var e in Object(t))dr.call(t,e)&&"constructor"!=e&&r.push(e);return r};var gr=function(t){return null!=t&&ar(t.length)&&!O(t)};var wr=function(t){return gr(t)?pr(t):_r(t)};var Or=function(t,r){return t&&Qt(r,wr(r),t)};var Ar=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},mr=Object.prototype.hasOwnProperty;var xr=function(t){if(!g(t))return Ar(t);var r=yr(t),e=[];for(var n in t)("constructor"!=n||!r&&mr.call(t,n))&&e.push(n);return e};var Sr=function(t){return gr(t)?pr(t,!0):xr(t)};var Pr=function(t,r){return t&&Qt(r,Sr(r),t)},zr=u(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=a?a(e):new t.constructor(e);return t.copy(n),n}});var Fr=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r};var Ir=function(t,r){for(var e=-1,n=null==t?0:t.length,o=0,a=[];++e<n;){var u=t[e];r(u,e,t)&&(a[o++]=u)}return a};var Ur=function(){return[]},Er=Object.prototype.propertyIsEnumerable,Mr=Object.getOwnPropertySymbols,kr=Mr?function(r){return null==r?[]:(r=Object(r),Ir(Mr(r),function(t){return Er.call(r,t)}))}:Ur;var Tr=function(t,r){return Qt(t,kr(t),r)};var $r=function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t},Br=hr(Object.getPrototypeOf,Object),Cr=Object.getOwnPropertySymbols?function(t){for(var r=[];t;)$r(r,kr(t)),t=Br(t);return r}:Ur;var Dr=function(t,r){return Qt(t,Cr(t),r)};var Rr=function(t,r,e){var n=r(t);return q(t)?n:$r(n,e(t))};var Vr=function(t){return Rr(t,wr,kr)};var qr=function(t){return Rr(t,Sr,Cr)},Nr=$(f,"DataView"),Wr=$(f,"Promise"),Lr=$(f,"Set"),Gr=$(f,"WeakMap"),Hr="[object Map]",Jr="[object Promise]",Kr="[object Set]",Qr="[object WeakMap]",Xr="[object DataView]",Yr=P(Nr),Zr=P(pt),te=P(Wr),re=P(Lr),ee=P(Gr),ne=_;(Nr&&ne(new Nr(new ArrayBuffer(1)))!=Xr||pt&&ne(new pt)!=Hr||Wr&&ne(Wr.resolve())!=Jr||Lr&&ne(new Lr)!=Kr||Gr&&ne(new Gr)!=Qr)&&(ne=function(t){var r=_(t),e="[object Object]"==r?t.constructor:void 0,n=e?P(e):"";if(n)switch(n){case Yr:return Xr;case Zr:return Hr;case te:return Jr;case re:return Kr;case ee:return Qr}return r});var oe=ne,ae=Object.prototype.hasOwnProperty;var ue=function(t){var r=t.length,e=new t.constructor(r);return r&&"string"==typeof t[0]&&ae.call(t,"index")&&(e.index=t.index,e.input=t.input),e},ce=f.Uint8Array;var ie=function(t){var r=new t.constructor(t.byteLength);return new ce(r).set(new ce(t)),r};var fe=function(t,r){var e=r?ie(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)},se=/\w*$/;var ve=function(t){var r=new t.constructor(t.source,se.exec(t));return r.lastIndex=t.lastIndex,r},le=s?s.prototype:void 0,pe=le?le.valueOf:void 0;var be=function(t){return pe?Object(pe.call(t)):{}};var ye=function(t,r){var e=r?ie(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var he=function(t,r,e){var n=t.constructor;switch(r){case"[object ArrayBuffer]":return ie(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return fe(t,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ye(t,e);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return ve(t);case"[object Set]":return new n;case"[object Symbol]":return be(t)}},je=Object.create,de=function(){function e(){}return function(t){if(!g(t))return{};if(je)return je(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var _e=function(t){return"function"!=typeof t.constructor||yr(t)?{}:de(Br(t))};var ge=function(t){return N(t)&&"[object Map]"==oe(t)},we=fr&&fr.isMap,Oe=we?ir(we):ge;var Ae=function(t){return N(t)&&"[object Set]"==oe(t)},me=fr&&fr.isSet,xe=me?ir(me):Ae,Se=1,Pe=2,ze=4,Fe="[object Arguments]",Ie="[object Function]",Ue="[object GeneratorFunction]",Ee="[object Object]",Me={};Me[Fe]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object DataView]"]=Me["[object Boolean]"]=Me["[object Date]"]=Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Map]"]=Me["[object Number]"]=Me[Ee]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object Symbol]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Error]"]=Me[Ie]=Me["[object WeakMap]"]=!1;var ke=function e(n,o,a,t,r,u){var c,i=o&Se,f=o&Pe,s=o&ze;if(a&&(c=r?a(n,t,r,u):a(n)),void 0!==c)return c;if(!g(n))return n;var v=q(n);if(v){if(c=ue(n),!i)return Fr(n,c)}else{var l=oe(n),p=l==Ie||l==Ue;if(or(n))return zr(n,i);if(l==Ee||l==Fe||p&&!r){if(c=f||p?{}:_e(n),!i)return f?Dr(n,Pr(c,n)):Tr(n,Or(c,n))}else{if(!Me[l])return r?n:{};c=he(n,l,i)}}u||(u=new Jt);var b=u.get(n);if(b)return b;if(u.set(n,c),xe(n))return n.forEach(function(t){c.add(e(t,o,a,t,n,u))}),c;if(Oe(n))return n.forEach(function(t,r){c.set(r,e(t,o,a,r,n,u))}),c;var y=s?f?qr:Vr:f?keysIn:wr,h=v?void 0:y(n);return Kt(h||n,function(t,r){h&&(t=n[r=t]),V(c,r,e(t,o,a,r,n,u))}),c};var Te=function(t){return ke(t,4)};t.action=function(u,c){return function(a){return t=regeneratorRuntime.mark(function t(r,e){var n,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n={type:u,payload:a},t.next=3,r(n);case 3:if(o=t.sent,!c){t.next=7;break}return t.next=7,c()(n,r,e);case 7:return t.abrupt("return",o);case 8:case"end":return t.stop()}},t,void 0)}),e=function(){var c=t.apply(this,arguments);return new Promise(function(a,u){return function r(t,e){try{var n=c[t](e),o=n.value}catch(t){return void u(t)}if(!n.done)return Promise.resolve(o).then(function(t){r("next",t)},function(t){r("throw",t)});a(o)}("next")})},function(t,r){return e.apply(this,arguments)};var t,e}},t.bindStateSelectors=a,t.connect=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r.connect(function(r){return o(t,function(t){return a(t,r)})},function(r){return o(e,function(t){return n.bindActionCreators(t,r)})})},t.push=function(t,r,e){return Dt(t,r,Vt(t,r,[]).concat(e))},t.set=function(t,r,e){return qt(Te(t),r,e,Te)},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("redux"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","redux","react-redux"],r):r(t.inaction={},t.redux,t.reactRedux)}(this,function(t,n,r){"use strict";var o=function(r,e){var n={};return Object.keys(r).forEach(function(t){n[t]=e(r[t])}),n},a=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];return o(t,function(t){return t.bind(null,r)})},e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,r){return t(r={exports:{}},r.exports),r.exports}var u="object"==typeof e&&e&&e.Object===Object&&e,i="object"==typeof self&&self&&self.Object===Object&&self,f=u||i||Function("return this")(),s=f.Symbol,v=Object.prototype,l=v.hasOwnProperty,p=v.toString,y=s?s.toStringTag:void 0;var b=function(t){var r=l.call(t,y),e=t[y];try{t[y]=void 0}catch(t){}var n=p.call(t);return r?t[y]=e:delete t[y],n},h=Object.prototype.toString;var j=function(t){return h.call(t)},d=s?s.toStringTag:void 0;var _=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":d&&d in Object(t)?b(t):j(t)};var g=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)};var w,O=function(t){if(!g(t))return!1;var r=_(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},A=f["__core-js_shared__"],m=(w=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var x=function(t){return!!m&&m in t},S=Function.prototype.toString;var P=function(t){if(null!=t){try{return S.call(t)}catch(t){}try{return t+""}catch(t){}}return""},z=/^\[object .+?Constructor\]$/,F=Function.prototype,I=Object.prototype,U=F.toString,E=I.hasOwnProperty,M=RegExp("^"+U.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var k=function(t){return!(!g(t)||x(t))&&(O(t)?M:z).test(P(t))};var T=function(t,r){return null==t?void 0:t[r]};var $=function(t,r){var e=T(t,r);return k(e)?e:void 0},B=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var C=function(t,r,e){"__proto__"==r&&B?B(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var D=function(t,r){return t===r||t!=t&&r!=r},R=Object.prototype.hasOwnProperty;var V=function(t,r,e){var n=t[r];R.call(t,r)&&D(n,e)&&(void 0!==e||r in t)||C(t,r,e)},q=Array.isArray;var N=function(t){return null!=t&&"object"==typeof t};var W=function(t){return"symbol"==typeof t||N(t)&&"[object Symbol]"==_(t)},L=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var H=function(t,r){if(q(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!W(t))||G.test(t)||!L.test(t)||null!=r&&t in Object(r)},J=$(Object,"create");var K=function(){this.__data__=J?J(null):{},this.size=0};var Q=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},X=Object.prototype.hasOwnProperty;var Y=function(t){var r=this.__data__;if(J){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return X.call(r,t)?r[t]:void 0},Z=Object.prototype.hasOwnProperty;var tt=function(t){var r=this.__data__;return J?void 0!==r[t]:Z.call(r,t)};var rt=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=J&&void 0===r?"__lodash_hash_undefined__":r,this};function et(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}et.prototype.clear=K,et.prototype.delete=Q,et.prototype.get=Y,et.prototype.has=tt,et.prototype.set=rt;var nt=et;var ot=function(){this.__data__=[],this.size=0};var at=function(t,r){for(var e=t.length;e--;)if(D(t[e][0],r))return e;return-1},ct=Array.prototype.splice;var ut=function(t){var r=this.__data__,e=at(r,t);return!(e<0||(e==r.length-1?r.pop():ct.call(r,e,1),--this.size,0))};var it=function(t){var r=this.__data__,e=at(r,t);return e<0?void 0:r[e][1]};var ft=function(t){return-1<at(this.__data__,t)};var st=function(t,r){var e=this.__data__,n=at(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function vt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}vt.prototype.clear=ot,vt.prototype.delete=ut,vt.prototype.get=it,vt.prototype.has=ft,vt.prototype.set=st;var lt=vt,pt=$(f,"Map");var yt=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var bt=function(t,r){var e=t.__data__;return yt(r)?e["string"==typeof r?"string":"hash"]:e.map};var ht=function(t){var r=bt(this,t).delete(t);return this.size-=r?1:0,r};var jt=function(t){return bt(this,t).get(t)};var dt=function(t){return bt(this,t).has(t)};var _t=function(t,r){var e=bt(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function gt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}gt.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(pt||lt),string:new nt}},gt.prototype.delete=ht,gt.prototype.get=jt,gt.prototype.has=dt,gt.prototype.set=_t;var wt=gt,Ot="Expected a function";function At(o,a){if("function"!=typeof o||null!=a&&"function"!=typeof a)throw new TypeError(Ot);var c=function(){var t=arguments,r=a?a.apply(this,t):t[0],e=c.cache;if(e.has(r))return e.get(r);var n=o.apply(this,t);return c.cache=e.set(r,n)||e,n};return c.cache=new(At.Cache||wt),c}At.Cache=wt;var mt=At;var xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/\\(\\)?/g,Pt=function(t){var r=mt(t,function(t){return 500===e.size&&e.clear(),t}),e=r.cache;return r}(function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(xt,function(t,r,e,n){o.push(e?n.replace(St,"$1"):r||t)}),o});var zt=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o},Ft=1/0,It=s?s.prototype:void 0,Ut=It?It.toString:void 0;var Et=function t(r){if("string"==typeof r)return r;if(q(r))return zt(r,t)+"";if(W(r))return Ut?Ut.call(r):"";var e=r+"";return"0"==e&&1/r==-Ft?"-0":e};var Mt=function(t){return null==t?"":Et(t)};var kt=function(t,r){return q(t)?t:H(t,r)?[t]:Pt(Mt(t))},Tt=/^(?:0|[1-9]\d*)$/;var $t=function(t,r){var e=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&Tt.test(t))&&-1<t&&t%1==0&&t<r};var Bt=function(t){if("string"==typeof t||W(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r};var Ct=function(t,r,e,n){if(!g(t))return t;for(var o=-1,a=(r=kt(r,t)).length,c=a-1,u=t;null!=u&&++o<a;){var i=Bt(r[o]),f=e;if(o!=c){var s=u[i];void 0===(f=n?n(s,i,u):void 0)&&(f=g(s)?s:$t(r[o+1])?[]:{})}V(u,i,f),u=u[i]}return t};var Dt=function(t,r,e){return null==t?t:Ct(t,r,e)};var Rt=function(t,r){for(var e=0,n=(r=kt(r,t)).length;null!=t&&e<n;)t=t[Bt(r[e++])];return e&&e==n?t:void 0};var Vt=function(t,r,e){var n=null==t?void 0:Rt(t,r);return void 0===n?e:n};var qt=function(t,r,e,n){return n="function"==typeof n?n:void 0,null==t?t:Ct(t,r,e,n)};var Nt=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var Wt=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)};var Gt=function(t,r){var e=this.__data__;if(e instanceof lt){var n=e.__data__;if(!pt||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new wt(n)}return e.set(t,r),this.size=e.size,this};function Ht(t){var r=this.__data__=new lt(t);this.size=r.size}Ht.prototype.clear=function(){this.__data__=new lt,this.size=0},Ht.prototype.delete=Nt,Ht.prototype.get=Wt,Ht.prototype.has=Lt,Ht.prototype.set=Gt;var Jt=Ht;var Kt=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n&&!1!==r(t[e],e,t););return t};var Qt=function(t,r,e,n){var o=!e;e||(e={});for(var a=-1,c=r.length;++a<c;){var u=r[a],i=n?n(e[u],t[u],u,e,t):void 0;void 0===i&&(i=t[u]),o?C(e,u,i):V(e,u,i)}return e};var Xt=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n};var Yt=function(t){return N(t)&&"[object Arguments]"==_(t)},Zt=Object.prototype,tr=Zt.hasOwnProperty,rr=Zt.propertyIsEnumerable,er=Yt(function(){return arguments}())?Yt:function(t){return N(t)&&tr.call(t,"callee")&&!rr.call(t,"callee")};var nr=function(){return!1},or=c(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=(o?o.isBuffer:void 0)||nr;t.exports=a});var ar=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},cr={};cr["[object Float32Array]"]=cr["[object Float64Array]"]=cr["[object Int8Array]"]=cr["[object Int16Array]"]=cr["[object Int32Array]"]=cr["[object Uint8Array]"]=cr["[object Uint8ClampedArray]"]=cr["[object Uint16Array]"]=cr["[object Uint32Array]"]=!0,cr["[object Arguments]"]=cr["[object Array]"]=cr["[object ArrayBuffer]"]=cr["[object Boolean]"]=cr["[object DataView]"]=cr["[object Date]"]=cr["[object Error]"]=cr["[object Function]"]=cr["[object Map]"]=cr["[object Number]"]=cr["[object Object]"]=cr["[object RegExp]"]=cr["[object Set]"]=cr["[object String]"]=cr["[object WeakMap]"]=!1;var ur=function(t){return N(t)&&ar(t.length)&&!!cr[_(t)]};var ir=function(r){return function(t){return r(t)}},fr=c(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&u.process,a=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),sr=fr&&fr.isTypedArray,vr=sr?ir(sr):ur,lr=Object.prototype.hasOwnProperty;var pr=function(t,r){var e=q(t),n=!e&&er(t),o=!e&&!n&&or(t),a=!e&&!n&&!o&&vr(t),c=e||n||o||a,u=c?Xt(t.length,String):[],i=u.length;for(var f in t)!r&&!lr.call(t,f)||c&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||$t(f,i))||u.push(f);return u},yr=Object.prototype;var br=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||yr)};var hr=function(r,e){return function(t){return r(e(t))}},jr=hr(Object.keys,Object),dr=Object.prototype.hasOwnProperty;var _r=function(t){if(!br(t))return jr(t);var r=[];for(var e in Object(t))dr.call(t,e)&&"constructor"!=e&&r.push(e);return r};var gr=function(t){return null!=t&&ar(t.length)&&!O(t)};var wr=function(t){return gr(t)?pr(t):_r(t)};var Or=function(t,r){return t&&Qt(r,wr(r),t)};var Ar=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},mr=Object.prototype.hasOwnProperty;var xr=function(t){if(!g(t))return Ar(t);var r=br(t),e=[];for(var n in t)("constructor"!=n||!r&&mr.call(t,n))&&e.push(n);return e};var Sr=function(t){return gr(t)?pr(t,!0):xr(t)};var Pr=function(t,r){return t&&Qt(r,Sr(r),t)},zr=c(function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=a?a(e):new t.constructor(e);return t.copy(n),n}});var Fr=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r};var Ir=function(t,r){for(var e=-1,n=null==t?0:t.length,o=0,a=[];++e<n;){var c=t[e];r(c,e,t)&&(a[o++]=c)}return a};var Ur=function(){return[]},Er=Object.prototype.propertyIsEnumerable,Mr=Object.getOwnPropertySymbols,kr=Mr?function(r){return null==r?[]:(r=Object(r),Ir(Mr(r),function(t){return Er.call(r,t)}))}:Ur;var Tr=function(t,r){return Qt(t,kr(t),r)};var $r=function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t},Br=hr(Object.getPrototypeOf,Object),Cr=Object.getOwnPropertySymbols?function(t){for(var r=[];t;)$r(r,kr(t)),t=Br(t);return r}:Ur;var Dr=function(t,r){return Qt(t,Cr(t),r)};var Rr=function(t,r,e){var n=r(t);return q(t)?n:$r(n,e(t))};var Vr=function(t){return Rr(t,wr,kr)};var qr=function(t){return Rr(t,Sr,Cr)},Nr=$(f,"DataView"),Wr=$(f,"Promise"),Lr=$(f,"Set"),Gr=$(f,"WeakMap"),Hr="[object Map]",Jr="[object Promise]",Kr="[object Set]",Qr="[object WeakMap]",Xr="[object DataView]",Yr=P(Nr),Zr=P(pt),te=P(Wr),re=P(Lr),ee=P(Gr),ne=_;(Nr&&ne(new Nr(new ArrayBuffer(1)))!=Xr||pt&&ne(new pt)!=Hr||Wr&&ne(Wr.resolve())!=Jr||Lr&&ne(new Lr)!=Kr||Gr&&ne(new Gr)!=Qr)&&(ne=function(t){var r=_(t),e="[object Object]"==r?t.constructor:void 0,n=e?P(e):"";if(n)switch(n){case Yr:return Xr;case Zr:return Hr;case te:return Jr;case re:return Kr;case ee:return Qr}return r});var oe=ne,ae=Object.prototype.hasOwnProperty;var ce=function(t){var r=t.length,e=new t.constructor(r);return r&&"string"==typeof t[0]&&ae.call(t,"index")&&(e.index=t.index,e.input=t.input),e},ue=f.Uint8Array;var ie=function(t){var r=new t.constructor(t.byteLength);return new ue(r).set(new ue(t)),r};var fe=function(t,r){var e=r?ie(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)},se=/\w*$/;var ve=function(t){var r=new t.constructor(t.source,se.exec(t));return r.lastIndex=t.lastIndex,r},le=s?s.prototype:void 0,pe=le?le.valueOf:void 0;var ye=function(t){return pe?Object(pe.call(t)):{}};var be=function(t,r){var e=r?ie(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var he=function(t,r,e){var n=t.constructor;switch(r){case"[object ArrayBuffer]":return ie(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return fe(t,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return be(t,e);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return ve(t);case"[object Set]":return new n;case"[object Symbol]":return ye(t)}},je=Object.create,de=function(){function e(){}return function(t){if(!g(t))return{};if(je)return je(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var _e=function(t){return"function"!=typeof t.constructor||br(t)?{}:de(Br(t))};var ge=function(t){return N(t)&&"[object Map]"==oe(t)},we=fr&&fr.isMap,Oe=we?ir(we):ge;var Ae=function(t){return N(t)&&"[object Set]"==oe(t)},me=fr&&fr.isSet,xe=me?ir(me):Ae,Se=1,Pe=2,ze=4,Fe="[object Arguments]",Ie="[object Function]",Ue="[object GeneratorFunction]",Ee="[object Object]",Me={};Me[Fe]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object DataView]"]=Me["[object Boolean]"]=Me["[object Date]"]=Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Map]"]=Me["[object Number]"]=Me[Ee]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object Symbol]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Error]"]=Me[Ie]=Me["[object WeakMap]"]=!1;var ke=function e(n,o,a,t,r,c){var u,i=o&Se,f=o&Pe,s=o&ze;if(a&&(u=r?a(n,t,r,c):a(n)),void 0!==u)return u;if(!g(n))return n;var v=q(n);if(v){if(u=ce(n),!i)return Fr(n,u)}else{var l=oe(n),p=l==Ie||l==Ue;if(or(n))return zr(n,i);if(l==Ee||l==Fe||p&&!r){if(u=f||p?{}:_e(n),!i)return f?Dr(n,Pr(u,n)):Tr(n,Or(u,n))}else{if(!Me[l])return r?n:{};u=he(n,l,i)}}c||(c=new Jt);var y=c.get(n);if(y)return y;if(c.set(n,u),xe(n))return n.forEach(function(t){u.add(e(t,o,a,t,n,c))}),u;if(Oe(n))return n.forEach(function(t,r){u.set(r,e(t,o,a,r,n,c))}),u;var b=s?f?qr:Vr:f?keysIn:wr,h=v?void 0:b(n);return Kt(h||n,function(t,r){h&&(t=n[r=t]),V(u,r,e(t,o,a,r,n,c))}),u};var Te=function(t){return ke(t,4)},$e=function(t,r,e){return qt(Te(t),r,e,Te)};function Be(t){if(Array.isArray(t)){for(var r=0,e=Array(t.length);r<t.length;r++)e[r]=t[r];return e}return Array.from(t)}t.action=function(c,u){return function(a){return t=regeneratorRuntime.mark(function t(r,e){var n,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n={type:c,payload:a},t.next=3,r(n);case 3:if(o=t.sent,!u){t.next=7;break}return t.next=7,u()(n,r,e);case 7:return t.abrupt("return",o);case 8:case"end":return t.stop()}},t,void 0)}),e=function(){var u=t.apply(this,arguments);return new Promise(function(a,c){return function r(t,e){try{var n=u[t](e),o=n.value}catch(t){return void c(t)}if(!n.done)return Promise.resolve(o).then(function(t){r("next",t)},function(t){r("throw",t)});a(o)}("next")})},function(t,r){return e.apply(this,arguments)};var t,e}},t.bindStateSelectors=a,t.connect=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r.connect(function(r){return o(t,function(t){return a(t,r)})},function(r){return o(e,function(t){return n.bindActionCreators(t,r)})})},t.push=function(t,r,e){return Dt(t,r,Vt(t,r,[]).concat(e))},t.set=$e,t.splice=function(t,r,e,n){var o=Vt(t,r,[]),a=[].concat(Be(o.slice(0,e)),[n],Be(o.slice(e)));return $e(t,r,a)},Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "inaction",
"version": "1.2.0",
"version": "1.3.0",
"description": "Assorted helpers for Redux.",

@@ -5,0 +5,0 @@ "repository": "github:olav/rection",

@@ -6,1 +6,2 @@ export * from "./action";

export * from "./set";
export * from "./splice";

@@ -5,6 +5,3 @@ import { push } from "./push";

expect(push({}, "a", 1)).toEqual({ a: [1] });
});
test("push append", async () => {
expect(push({ a: [1, 2] }, "a", 3)).toEqual({ a: [1, 2, 3] });
});

@@ -6,4 +6,2 @@ import setWith from "lodash/setWith";

//
// This will shallow clone only the objects in the path that changed.
//
// See: https://github.com/lodash/lodash/issues/1696#issuecomment-328335502

@@ -10,0 +8,0 @@ //

import { set } from "./set";
test("set", async () => {
expect(set({}, "a.b.c", 1)).toEqual({ a: { b: { c: 1 } } });
});
test("set clone", async () => {

@@ -10,5 +14,1 @@ const a = { a: 1 };

});
test("set path", async () => {
expect(set({}, "a.b.c", 1)).toEqual({ a: { b: { c: 1 } } });
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc