Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.5.0 to 2.0.0

src/mapValues.js

49

dist/index.cjs.js

@@ -5,11 +5,4 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var mapValues = _interopDefault(require('lodash/mapValues'));
var redux = require('redux');
var reactRedux = require('react-redux');
var set = _interopDefault(require('lodash/set'));
var get = _interopDefault(require('lodash/get'));
var setWith = _interopDefault(require('lodash/setWith'));
var clone = _interopDefault(require('lodash/clone'));

@@ -67,2 +60,13 @@ var _this = undefined;

// Map over object values.
var mapValues = function mapValues(obj, fn) {
var res = {};
Object.keys(obj).forEach(function (k) {
res[k] = fn(obj[k]);
});
return res;
};
// Helper that binds state to selectors.

@@ -97,35 +101,4 @@ //

// Update @state by appending a @value to the array at @path.
//
// A new array is created if the current value of @path is undefined.
//
var push = function push(state, path, value) {
return set(state, path, get(state, path, []).concat(value));
};
// Update @state with a new @value at @path.
//
// See: https://github.com/lodash/lodash/issues/1696#issuecomment-328335502
//
var set$1 = function set$$1(state, path, value) {
return setWith(clone(state), path, value, clone);
};
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;
exports.bindStateSelectors = bindStateSelectors;
exports.connect = connect;
exports.push = push;
exports.set = set$1;
exports.splice = splice;

@@ -1,8 +0,3 @@

import mapValues from 'lodash/mapValues';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import set from 'lodash/set';
import get from 'lodash/get';
import setWith from 'lodash/setWith';
import clone from 'lodash/clone';

@@ -60,2 +55,13 @@ var _this = undefined;

// Map over object values.
var mapValues = function mapValues(obj, fn) {
var res = {};
Object.keys(obj).forEach(function (k) {
res[k] = fn(obj[k]);
});
return res;
};
// Helper that binds state to selectors.

@@ -90,30 +96,2 @@ //

// Update @state by appending a @value to the array at @path.
//
// A new array is created if the current value of @path is undefined.
//
var push = function push(state, path, value) {
return set(state, path, get(state, path, []).concat(value));
};
// Update @state with a new @value at @path.
//
// See: https://github.com/lodash/lodash/issues/1696#issuecomment-328335502
//
var set$1 = function set$$1(state, path, value) {
return setWith(clone(state), path, value, clone);
};
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 };
export { action, bindStateSelectors, connect$1 as connect };

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

@@ -9,2 +11,9 @@ "repository": "github:olav/rection",

"browser": "dist/index.umd.js",
"scripts": {
"build": "rollup -c --silent",
"dev": "rollup -c -w --silent",
"test": "npm run fmt && npm run lint && npm run build && jest",
"lint": "eslint --max-warnings 0 src && madge --circular src/index.js",
"fmt": "prettier --write 'src{,/**}/*.{css,js,json}'"
},
"eslintConfig": {

@@ -20,6 +29,6 @@ "parserOptions": {

"eslint": "^4.19.1",
"jest": "^22.4.3",
"madge": "^3.0.1",
"jest": "^23.0.0",
"madge": "^3.1.1",
"prettier": "^1.12.1",
"rollup": "^0.59.1",
"rollup": "^0.59.3",
"rollup-plugin-babel": "^3.0.4",

@@ -31,16 +40,6 @@ "rollup-plugin-commonjs": "^9.1.3",

"dependencies": {
"lodash": "^4.17.10",
"react": "^16.3.2",
"react": "^16.4.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0"
},
"scripts": {
"build": "rollup -c --silent",
"dev": "rollup -c -w --silent",
"test": "npm run fmt && npm run lint && npm run build && jest",
"lint": "eslint --max-warnings 0 src && madge --circular src/index.js",
"fmt": "prettier --write 'src{,/**}/*.{css,js,json}'"
},
"author": "olav",
"license": "Apache-2.0"
}
}
# inaction
Assorted helpers for Redux.
Assorted helpers for using Redux with React.

@@ -5,0 +5,0 @@ ## License

import { action } from "./action";
const testAction = {
type: "test/action",
payload: { k1: "v1" }
};
test("action", async () => {
const creator = action(testAction.type)(testAction.payload);
const dispatch = a => a;
expect(await creator(dispatch)).toEqual(testAction);
const a = { type: "test/action", payload: { a: 1 } };
const creator = action(a.type)(a.payload);
const dispatch = x => x;
expect(await creator(dispatch)).toEqual(a);
});
test("action with factory", async () => {
test("action factory", async () => {
expect.assertions(2);
const factory = () => a => expect(a).toEqual(testAction);
const creator = action(testAction.type, factory)(testAction.payload);
expect(await creator(a => a)).toEqual(testAction);
const a = { type: "test/action", payload: { a: 1 } };
const factory = () => x => expect(x).toEqual(a);
const creator = action(a.type, factory)(a.payload);
expect(await creator(x => x)).toEqual(a);
});

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

import mapValues from "lodash/mapValues";
import { mapValues } from "./mapValues";

@@ -3,0 +3,0 @@ // Helper that binds state to selectors.

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

import mapValues from "lodash/mapValues";
import { bindActionCreators } from "redux";
import { connect as reduxConnect } from "react-redux";
import { mapValues } from "./mapValues";
import { bindStateSelectors } from "./bindStateSelectors";

@@ -5,0 +5,0 @@

export * from "./action";
export * from "./bindStateSelectors";
export * from "./connect";
export * from "./push";
export * from "./set";
export * from "./splice";
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