New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jumpn/utils-composite

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

@jumpn/utils-composite - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

5

compat/cjs/get.js

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');

@@ -19,2 +20,4 @@ var _this = undefined;

module.exports = get;
var get$1 = Fun.curry(get);
module.exports = get$1;

13

compat/cjs/getIn.js

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var utilsArray = require('@jumpn/utils-array');

@@ -20,2 +21,4 @@

var get$1 = Fun.curry(get);
var _this$2 = undefined;

@@ -33,2 +36,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this = undefined;

@@ -39,5 +44,5 @@

if (utilsArray.isLastIndex(path, index)) return get(path[index], composite);
if (utilsArray.isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -54,2 +59,4 @@

module.exports = getIn;
var getIn$1 = Fun.curry(getIn);
module.exports = getIn$1;

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var utilsArray = require('@jumpn/utils-array');

@@ -20,2 +21,4 @@

var get$1 = Fun.curry(get);
var _this$3 = undefined;

@@ -33,2 +36,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$1 = undefined;

@@ -39,5 +44,5 @@

if (utilsArray.isLastIndex(path, index)) return get(path[index], composite);
if (utilsArray.isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -54,2 +59,4 @@

var getIn$1 = Fun.curry(getIn);
var _this = undefined;

@@ -64,5 +71,7 @@

return getIn(path, composite) === value;
return getIn$1(path, composite) === value;
}.bind(undefined);
module.exports = hasIn;
var hasIn$1 = Fun.curry(hasIn);
module.exports = hasIn$1;

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');

@@ -20,2 +21,4 @@ var _this = undefined;

module.exports = hasKey;
var hasKey$1 = Fun.curry(hasKey);
module.exports = hasKey$1;

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));

@@ -21,2 +22,4 @@ var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));

var get$1 = Fun.curry(get);
var _this$2 = undefined;

@@ -45,2 +48,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this = undefined;

@@ -59,6 +64,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
module.exports = haveSameProps;
var haveSameProps$1 = Fun.curry(haveSameProps);
module.exports = haveSameProps$1;

@@ -8,2 +8,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var utilsArray = require('@jumpn/utils-array');

@@ -14,2 +15,3 @@ var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));

var arrayRemove = _interopDefault(require('@jumpn/utils-array/dist/remove'));
var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign'));
var _Symbol = _interopDefault(require('babel-runtime/core-js/symbol'));

@@ -29,2 +31,4 @@ var _extends = _interopDefault(require('babel-runtime/helpers/extends'));

var get$1 = Fun.curry(get);
var _this$2 = undefined;

@@ -42,2 +46,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$1 = undefined;

@@ -48,5 +54,5 @@

if (utilsArray.isLastIndex(path, index)) return get(path[index], composite);
if (utilsArray.isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -63,2 +69,4 @@

var getIn$1 = Fun.curry(getIn);
var _this$3 = undefined;

@@ -84,5 +92,7 @@

return getIn(path, composite) === value;
return getIn$1(path, composite) === value;
}.bind(undefined);
var hasIn$1 = Fun.curry(hasIn);
var _this$5 = undefined;

@@ -101,6 +111,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
var haveSameProps$1 = Fun.curry(haveSameProps);
var _this$6 = undefined;

@@ -128,2 +140,4 @@

var remove$1 = Fun.curry(remove);
var _this$9 = undefined;

@@ -159,3 +173,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -166,3 +180,3 @@

return utilsArray.isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return utilsArray.isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -176,3 +190,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -183,3 +197,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -223,3 +237,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -233,3 +247,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(Fun.curry(updateIn), { remove: removeAction });

@@ -248,3 +262,3 @@ var _this$7 = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$7);

@@ -256,2 +270,4 @@

var removeIn$1 = Fun.curry(removeIn);
var _this$10 = undefined;

@@ -273,2 +289,4 @@

var set$2 = Fun.curry(set$1);
var _this$11 = undefined;

@@ -285,3 +303,3 @@

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$11);

@@ -293,2 +311,4 @@

var setIn$1 = Fun.curry(setIn);
var _this$12 = undefined;

@@ -310,17 +330,19 @@

return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps(c1, c2);
return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps$1(c1, c2);
}.bind(undefined);
exports.get = get;
exports.getIn = getIn;
var shallowEqual$1 = Fun.curry(shallowEqual);
exports.get = get$1;
exports.getIn = getIn$1;
exports.getKeys = getKeys;
exports.hasIn = hasIn;
exports.hasKey = hasKey;
exports.haveSameProps = haveSameProps;
exports.remove = remove;
exports.removeIn = removeIn;
exports.set = set$1;
exports.setIn = setIn;
exports.hasIn = hasIn$1;
exports.hasKey = hasKey$1;
exports.haveSameProps = haveSameProps$1;
exports.remove = remove$1;
exports.removeIn = removeIn$1;
exports.set = set$2;
exports.setIn = setIn$1;
exports.shallowCopy = shallowCopy;
exports.shallowEqual = shallowEqual;
exports.updateIn = updateIn;
exports.shallowEqual = shallowEqual$1;
exports.updateIn = updateIn$1;

@@ -8,2 +8,3 @@ 'use strict';

var arrayRemove = _interopDefault(require('@jumpn/utils-array/dist/remove'));
var Fun = require('flow-static-land/lib/Fun');

@@ -32,2 +33,4 @@ var _this = undefined;

module.exports = remove;
var remove$1 = Fun.curry(remove);
module.exports = remove$1;

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

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign'));
var _Symbol = _interopDefault(require('babel-runtime/core-js/symbol'));

@@ -25,2 +27,4 @@ var utilsArray = require('@jumpn/utils-array');

var get$1 = Fun.curry(get);
var _this$3 = undefined;

@@ -38,2 +42,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$4 = undefined;

@@ -61,2 +67,4 @@

var remove$1 = Fun.curry(remove);
var _this$5 = undefined;

@@ -92,3 +100,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -99,3 +107,3 @@

return utilsArray.isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return utilsArray.isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -109,3 +117,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -116,3 +124,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -156,3 +164,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -166,3 +174,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(Fun.curry(updateIn), { remove: removeAction });

@@ -181,3 +189,3 @@ var _this = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this);

@@ -189,2 +197,4 @@

module.exports = removeIn;
var removeIn$1 = Fun.curry(removeIn);
module.exports = removeIn$1;

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var _extends = _interopDefault(require('babel-runtime/helpers/extends'));

@@ -37,2 +38,4 @@ var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));

module.exports = set;
var set$1 = Fun.curry(set);
module.exports = set$1;

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

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign'));
var _Symbol = _interopDefault(require('babel-runtime/core-js/symbol'));

@@ -25,2 +27,4 @@ var utilsArray = require('@jumpn/utils-array');

var get$1 = Fun.curry(get);
var _this$3 = undefined;

@@ -38,2 +42,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$4 = undefined;

@@ -61,2 +67,4 @@

var remove$1 = Fun.curry(remove);
var _this$5 = undefined;

@@ -92,3 +100,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -99,3 +107,3 @@

return utilsArray.isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return utilsArray.isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -109,3 +117,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -116,3 +124,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -156,3 +164,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -166,3 +174,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(Fun.curry(updateIn), { remove: removeAction });

@@ -180,3 +188,3 @@ var _this = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this);

@@ -188,2 +196,4 @@

module.exports = setIn;
var setIn$1 = Fun.curry(setIn);
module.exports = setIn$1;

@@ -6,2 +6,3 @@ 'use strict';

var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));

@@ -21,2 +22,4 @@ var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));

var get$1 = Fun.curry(get);
var _this$3 = undefined;

@@ -45,2 +48,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$1 = undefined;

@@ -59,6 +64,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
var haveSameProps$1 = Fun.curry(haveSameProps);
var _this = undefined;

@@ -80,5 +87,7 @@

return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps(c1, c2);
return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps$1(c1, c2);
}.bind(undefined);
module.exports = shallowEqual;
var shallowEqual$1 = Fun.curry(shallowEqual);
module.exports = shallowEqual$1;

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

var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign'));
var _Symbol = _interopDefault(require('babel-runtime/core-js/symbol'));
var _newArrowCheck = _interopDefault(require('babel-runtime/helpers/newArrowCheck'));
var Fun = require('flow-static-land/lib/Fun');
var utilsArray = require('@jumpn/utils-array');

@@ -25,2 +27,4 @@ var _objectWithoutProperties = _interopDefault(require('babel-runtime/helpers/objectWithoutProperties'));

var get$1 = Fun.curry(get);
var _this$2 = undefined;

@@ -38,2 +42,4 @@

var hasKey$1 = Fun.curry(hasKey);
var _this$3 = undefined;

@@ -61,2 +67,4 @@

var remove$1 = Fun.curry(remove);
var _this$4 = undefined;

@@ -92,3 +100,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -99,3 +107,3 @@

return utilsArray.isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return utilsArray.isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -109,3 +117,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -116,3 +124,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -156,3 +164,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -166,4 +174,4 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(Fun.curry(updateIn), { remove: removeAction });
module.exports = updateIn;
module.exports = updateIn$1;
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.UtilsArray = {})));
(factory((global.UtilsComposite = {})));
}(this, (function (exports) { 'use strict';

@@ -29,2 +29,111 @@

var Fun = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.flip = flip;
exports.constant = constant;
exports.on = on;
exports.compose = compose;
exports.pipe = pipe;
exports.curry = curry;
// eslint-disable-line no-redeclare
// Flips the order of the arguments to a function of two arguments.
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
function flip(f) {
return function (b, a) {
return f(a, b);
};
}
// Returns its first argument and ignores its second.
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
// eslint-disable-line no-redeclare
function constant(a) {
return function () {
return a;
};
}
// The `on` function is used to change the domain of a binary operator.
function on(o, f) {
return function (x, y) {
return o(f(x), f(y));
};
}
function compose() {
var _this = this;
for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
// eslint-disable-line no-redeclare
var len = fns.length - 1;
return function (x) {
var y = x;
for (var _i = len; _i > -1; _i--) {
y = fns[_i].call(_this, y);
}
return y;
};
}
function pipe() {
var _this2 = this;
for (var _len2 = arguments.length, fns = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
fns[_key2] = arguments[_key2];
}
// eslint-disable-line no-redeclare
var len = fns.length - 1;
return function (x) {
var y = x;
for (var _i2 = 0; _i2 <= len; _i2++) {
y = fns[_i2].call(_this2, y);
}
return y;
};
}
function curried(f, length, acc) {
return function () {
var combined = acc.concat(Array.prototype.slice.call(arguments));
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
};
}
function curry(f) {
// eslint-disable-line no-redeclare
return curried(f, f.length, []);
}
});
unwrapExports(Fun);
var Fun_6 = Fun.curry;
var _this = undefined;

@@ -41,2 +150,4 @@

var get$1 = Fun_6(get);
// 7.1.4 ToInteger

@@ -775,9 +886,9 @@ var ceil = Math.ceil;

var assign$2 = _core.Object.assign;
var assign$1 = _core.Object.assign;
var assign = createCommonjsModule(function (module) {
module.exports = { "default": assign$2, __esModule: true };
module.exports = { "default": assign$1, __esModule: true };
});
unwrapExports(assign);
var _Object$assign = unwrapExports(assign);

@@ -1112,2 +1223,4 @@ var _extends = createCommonjsModule(function (module, exports) {

var hasKey$1 = Fun_6(hasKey);
var _this$1 = undefined;

@@ -1118,5 +1231,5 @@

if (isLastIndex(path, index)) return get(path[index], composite);
if (isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -1133,2 +1246,4 @@

var getIn$1 = Fun_6(getIn);
var _this$4$1 = undefined;

@@ -1154,5 +1269,7 @@

return getIn(path, composite) === value;
return getIn$1(path, composite) === value;
}.bind(undefined);
var hasIn$1 = Fun_6(hasIn);
var _this$6$1 = undefined;

@@ -1171,6 +1288,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
var haveSameProps$1 = Fun_6(haveSameProps);
var _this$8$1 = undefined;

@@ -1210,2 +1329,4 @@

var remove$2 = Fun_6(remove$1);
var _meta = createCommonjsModule(function (module) {

@@ -1629,3 +1750,3 @@ var META = _uid('meta');

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -1636,3 +1757,3 @@

return isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -1646,3 +1767,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -1653,3 +1774,3 @@

var removed = remove$1(path[index], context.current);
var removed = remove$2(path[index], context.current);

@@ -1693,3 +1814,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -1703,3 +1824,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(Fun_6(updateIn), { remove: removeAction });

@@ -1718,3 +1839,3 @@ var _this$9$1 = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$9$1);

@@ -1726,2 +1847,4 @@

var removeIn$1 = Fun_6(removeIn);
var _this$12$1 = undefined;

@@ -1743,2 +1866,4 @@

var set$2 = Fun_6(set$1);
var _this$13$1 = undefined;

@@ -1755,3 +1880,3 @@

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$13$1);

@@ -1763,2 +1888,4 @@

var setIn$1 = Fun_6(setIn);
var _this$14$1 = undefined;

@@ -1780,18 +1907,20 @@

return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps(c1, c2);
return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps$1(c1, c2);
}.bind(undefined);
exports.get = get;
exports.getIn = getIn;
var shallowEqual$1 = Fun_6(shallowEqual);
exports.get = get$1;
exports.getIn = getIn$1;
exports.getKeys = getKeys$1;
exports.hasIn = hasIn;
exports.hasKey = hasKey;
exports.haveSameProps = haveSameProps;
exports.remove = remove$1;
exports.removeIn = removeIn;
exports.set = set$1;
exports.setIn = setIn;
exports.hasIn = hasIn$1;
exports.hasKey = hasKey$1;
exports.haveSameProps = haveSameProps$1;
exports.remove = remove$2;
exports.removeIn = removeIn$1;
exports.set = set$2;
exports.setIn = setIn$1;
exports.shallowCopy = shallowCopy;
exports.shallowEqual = shallowEqual;
exports.updateIn = updateIn;
exports.shallowEqual = shallowEqual$1;
exports.updateIn = updateIn$1;

@@ -1798,0 +1927,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';

@@ -14,2 +15,4 @@ var _this = undefined;

export default get;
var get$1 = curry(get);
export default get$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import { isLastIndex } from '@jumpn/utils-array';

@@ -15,2 +16,4 @@

var get$1 = curry(get);
var _this$2 = undefined;

@@ -28,2 +31,4 @@

var hasKey$1 = curry(hasKey);
var _this = undefined;

@@ -34,5 +39,5 @@

if (isLastIndex(path, index)) return get(path[index], composite);
if (isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -49,2 +54,4 @@

export default getIn;
var getIn$1 = curry(getIn);
export default getIn$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import { isLastIndex } from '@jumpn/utils-array';

@@ -15,2 +16,4 @@

var get$1 = curry(get);
var _this$3 = undefined;

@@ -28,2 +31,4 @@

var hasKey$1 = curry(hasKey);
var _this$1 = undefined;

@@ -34,5 +39,5 @@

if (isLastIndex(path, index)) return get(path[index], composite);
if (isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -49,2 +54,4 @@

var getIn$1 = curry(getIn);
var _this = undefined;

@@ -59,5 +66,7 @@

return getIn(path, composite) === value;
return getIn$1(path, composite) === value;
}.bind(undefined);
export default hasIn;
var hasIn$1 = curry(hasIn);
export default hasIn$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';

@@ -15,2 +16,4 @@ var _this = undefined;

export default hasKey;
var hasKey$1 = curry(hasKey);
export default hasKey$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import _Object$keys from 'babel-runtime/core-js/object/keys';

@@ -16,2 +17,4 @@ import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';

var get$1 = curry(get);
var _this$2 = undefined;

@@ -40,2 +43,4 @@

var hasKey$1 = curry(hasKey);
var _this = undefined;

@@ -54,6 +59,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
export default haveSameProps;
var haveSameProps$1 = curry(haveSameProps);
export default haveSameProps$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import { isLastIndex } from '@jumpn/utils-array';

@@ -7,2 +8,3 @@ import _Object$keys from 'babel-runtime/core-js/object/keys';

import arrayRemove from '@jumpn/utils-array/dist/remove';
import _Object$assign from 'babel-runtime/core-js/object/assign';
import _Symbol from 'babel-runtime/core-js/symbol';

@@ -22,2 +24,4 @@ import _extends from 'babel-runtime/helpers/extends';

var get$1 = curry(get);
var _this$2 = undefined;

@@ -35,2 +39,4 @@

var hasKey$1 = curry(hasKey);
var _this$1 = undefined;

@@ -41,5 +47,5 @@

if (isLastIndex(path, index)) return get(path[index], composite);
if (isLastIndex(path, index)) return get$1(path[index], composite);
return hasKey(path[index], composite) ? getInRecur(index + 1, path, get(path[index], composite)) : undefined;
return hasKey$1(path[index], composite) ? getInRecur(index + 1, path, get$1(path[index], composite)) : undefined;
}.bind(undefined);

@@ -56,2 +62,4 @@

var getIn$1 = curry(getIn);
var _this$3 = undefined;

@@ -77,5 +85,7 @@

return getIn(path, composite) === value;
return getIn$1(path, composite) === value;
}.bind(undefined);
var hasIn$1 = curry(hasIn);
var _this$5 = undefined;

@@ -94,6 +104,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
var haveSameProps$1 = curry(haveSameProps);
var _this$6 = undefined;

@@ -121,2 +133,4 @@

var remove$1 = curry(remove);
var _this$9 = undefined;

@@ -152,3 +166,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -159,3 +173,3 @@

return isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -169,3 +183,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -176,3 +190,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -216,3 +230,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -226,3 +240,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(curry(updateIn), { remove: removeAction });

@@ -241,3 +255,3 @@ var _this$7 = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$7);

@@ -249,2 +263,4 @@

var removeIn$1 = curry(removeIn);
var _this$10 = undefined;

@@ -266,2 +282,4 @@

var set$2 = curry(set$1);
var _this$11 = undefined;

@@ -278,3 +296,3 @@

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this$11);

@@ -286,2 +304,4 @@

var setIn$1 = curry(setIn);
var _this$12 = undefined;

@@ -303,5 +323,7 @@

return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps(c1, c2);
return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps$1(c1, c2);
}.bind(undefined);
export { get, getIn, getKeys, hasIn, hasKey, haveSameProps, remove, removeIn, set$1 as set, setIn, shallowCopy, shallowEqual, updateIn };
var shallowEqual$1 = curry(shallowEqual);
export { get$1 as get, getIn$1 as getIn, getKeys, hasIn$1 as hasIn, hasKey$1 as hasKey, haveSameProps$1 as haveSameProps, remove$1 as remove, removeIn$1 as removeIn, set$2 as set, setIn$1 as setIn, shallowCopy, shallowEqual$1 as shallowEqual, updateIn$1 as updateIn };
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import arrayRemove from '@jumpn/utils-array/dist/remove';
import { curry } from 'flow-static-land/lib/Fun';

@@ -27,2 +28,4 @@ var _this = undefined;

export default remove;
var remove$1 = curry(remove);
export default remove$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import _Object$assign from 'babel-runtime/core-js/object/assign';
import _Symbol from 'babel-runtime/core-js/symbol';

@@ -20,2 +22,4 @@ import { isLastIndex } from '@jumpn/utils-array';

var get$1 = curry(get);
var _this$3 = undefined;

@@ -33,2 +37,4 @@

var hasKey$1 = curry(hasKey);
var _this$4 = undefined;

@@ -56,2 +62,4 @@

var remove$1 = curry(remove);
var _this$5 = undefined;

@@ -87,3 +95,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -94,3 +102,3 @@

return isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -104,3 +112,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -111,3 +119,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -151,3 +159,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -161,3 +169,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(curry(updateIn), { remove: removeAction });

@@ -176,3 +184,3 @@ var _this = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this);

@@ -184,2 +192,4 @@

export default removeIn;
var removeIn$1 = curry(removeIn);
export default removeIn$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import _extends from 'babel-runtime/helpers/extends';

@@ -32,2 +33,4 @@ import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';

export default set;
var set$1 = curry(set);
export default set$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import _Object$assign from 'babel-runtime/core-js/object/assign';
import _Symbol from 'babel-runtime/core-js/symbol';

@@ -20,2 +22,4 @@ import { isLastIndex } from '@jumpn/utils-array';

var get$1 = curry(get);
var _this$3 = undefined;

@@ -33,2 +37,4 @@

var hasKey$1 = curry(hasKey);
var _this$4 = undefined;

@@ -56,2 +62,4 @@

var remove$1 = curry(remove);
var _this$5 = undefined;

@@ -87,3 +95,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -94,3 +102,3 @@

return isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -104,3 +112,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -111,3 +119,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -151,3 +159,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -161,3 +169,3 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(curry(updateIn), { remove: removeAction });

@@ -175,3 +183,3 @@ var _this = undefined;

return updateIn(path, function () {
return updateIn$1(path, function () {
_newArrowCheck(this, _this);

@@ -183,2 +191,4 @@

export default setIn;
var setIn$1 = curry(setIn);
export default setIn$1;
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import _Object$keys from 'babel-runtime/core-js/object/keys';

@@ -16,2 +17,4 @@ import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';

var get$1 = curry(get);
var _this$3 = undefined;

@@ -40,2 +43,4 @@

var hasKey$1 = curry(hasKey);
var _this$1 = undefined;

@@ -54,6 +59,8 @@

return hasKey(k1, c2) && get(k1, c1) === get(k1, c2);
return hasKey$1(k1, c2) && get$1(k1, c1) === get$1(k1, c2);
}.bind(this));
}.bind(undefined);
var haveSameProps$1 = curry(haveSameProps);
var _this = undefined;

@@ -75,5 +82,7 @@

return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps(c1, c2);
return c1 === c2 || !xor(Array.isArray(c1), Array.isArray(c2)) && haveSameProps$1(c1, c2);
}.bind(undefined);
export default shallowEqual;
var shallowEqual$1 = curry(shallowEqual);
export default shallowEqual$1;

@@ -0,3 +1,5 @@

import _Object$assign from 'babel-runtime/core-js/object/assign';
import _Symbol from 'babel-runtime/core-js/symbol';
import _newArrowCheck from 'babel-runtime/helpers/newArrowCheck';
import { curry } from 'flow-static-land/lib/Fun';
import { isLastIndex } from '@jumpn/utils-array';

@@ -20,2 +22,4 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';

var get$1 = curry(get);
var _this$2 = undefined;

@@ -33,2 +37,4 @@

var hasKey$1 = curry(hasKey);
var _this$3 = undefined;

@@ -56,2 +62,4 @@

var remove$1 = curry(remove);
var _this$4 = undefined;

@@ -87,3 +95,3 @@

return hasKey(key, current) ? shallowCopy(get(key, current)) : createSupporting(nextKey);
return hasKey$1(key, current) ? shallowCopy(get$1(key, current)) : createSupporting(nextKey);
}.bind(undefined);

@@ -94,3 +102,3 @@

return isLastIndex(path, index) ? updater(get(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
return isLastIndex(path, index) ? updater(get$1(path[index], current)) : copyOrCreate(path[index], path[index + 1], current);
}.bind(undefined);

@@ -104,3 +112,3 @@

return get(key, composite);
return get$1(key, composite);
}.bind(undefined);

@@ -111,3 +119,3 @@

var removed = remove(path[index], context.current);
var removed = remove$1(path[index], context.current);

@@ -151,3 +159,3 @@ return index === 0 ? removed : set(path[index - 1], removed, context.previous);

*
* Entry removal is supported by returning updateIn.remove symbol on updater
* Entry removal is supported by returning `updateIn.remove` symbol on updater
* function.

@@ -161,4 +169,4 @@ */

updateIn.remove = removeAction;
var updateIn$1 = _Object$assign(curry(updateIn), { remove: removeAction });
export default updateIn;
export default updateIn$1;
{
"name": "@jumpn/utils-composite",
"version": "0.1.1",
"version": "0.2.0",
"description": "Composite utilities (immutability, fp helpers)",

@@ -12,3 +12,3 @@ "module": "dist/index.js",

"build:flow": "yarn flow-copy-source dist && yarn flow-copy-source compat/cjs",
"build:index": "create-index --banner '// @flow' src/ && yarn lint:fix src/index.js && sed -f indexIgnore.sed -i src/index.js",
"build:index": "create-index --banner '// @flow' src/ && sed -f indexIgnore.sed -i src/index.js && yarn lint:fix src/index.js",
"build:readme": "pkg-to-readme --template ./readmeTemplate.ejs --force && documentation readme src/** --section API",

@@ -56,4 +56,2 @@ "build:src": "rollup -c",

"@commitlint/config-angular": "3.1.1",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-eslint": "8.0.0",

@@ -60,0 +58,0 @@ "babel-plugin-transform-runtime": "6.23.0",

# @jumpn/utils-composite
> Composite utilities (immutability, fp helpers)
>
> **NOTE**: All functions the functions described in [API](#API) are curried

@@ -98,3 +100,2 @@ ## Types

- `path` **Path**
- `value` **any**
- `composite` **Composite**

@@ -149,3 +150,3 @@

Entry removal is supported by returning updateIn.remove symbol on updater
Entry removal is supported by returning `updateIn.remove` symbol on updater
function.

@@ -152,0 +153,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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