rambda 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1615 -1474
  3. package/dist/rambda.js +96 -82
  4. package/dist/rambda.mjs +95 -83
  5. package/dist/rambda.umd.js +1 -1
  6. package/immutable.d.ts +15 -5
  7. package/index.d.ts +15 -5
  8. package/package.json +17 -14
  9. package/src/_internals/constants.js +1 -0
  10. package/src/_internals/isArray.js +1 -0
  11. package/src/_internals/isFalsy.js +2 -2
  12. package/src/_internals/isInteger.js +5 -0
  13. package/src/_internals/isIterable.js +5 -0
  14. package/src/_internals/isObject.js +1 -1
  15. package/src/_internals/isTruthy.js +2 -2
  16. package/src/_internals/keys.js +1 -0
  17. package/src/_internals/{_objectIs.js → objectIs.js} +2 -2
  18. package/src/applySpec.js +3 -3
  19. package/src/assocPath.js +7 -7
  20. package/src/clone.js +2 -2
  21. package/src/count.js +2 -2
  22. package/src/dropLastWhile.js +2 -2
  23. package/src/dropRepeats.js +2 -2
  24. package/src/dropRepeatsWith.js +2 -2
  25. package/src/dropWhile.js +2 -2
  26. package/src/endsWith.js +2 -2
  27. package/src/equals.js +3 -3
  28. package/src/evolve.js +1 -1
  29. package/src/filter.js +2 -2
  30. package/src/flatten.js +2 -2
  31. package/src/forEach.js +6 -6
  32. package/src/groupWith.js +2 -2
  33. package/src/identical.js +2 -2
  34. package/src/includes.js +2 -2
  35. package/src/isPromise.js +1 -1
  36. package/src/length.js +2 -2
  37. package/src/map.js +7 -7
  38. package/src/mathMod.js +2 -2
  39. package/src/merge.js +1 -1
  40. package/src/mergeDeepRight.js +2 -1
  41. package/src/mergeRight.js +2 -1
  42. package/src/modify.js +23 -0
  43. package/src/modifyPath.js +2 -2
  44. package/src/partialObject.js +1 -11
  45. package/src/partition.js +2 -2
  46. package/src/props.js +2 -2
  47. package/src/reduce.js +2 -3
  48. package/src/splitAt.js +2 -2
  49. package/src/startsWith.js +2 -2
  50. package/src/takeLastWhile.js +2 -2
  51. package/src/takeWhile.js +2 -2
  52. package/src/times.js +2 -1
  53. package/src/transpose.js +2 -2
  54. package/src/unwind.js +4 -3
  55. package/src/update.js +1 -1
  56. package/src/where.js +1 -0
  57. package/src/_internals/_isArray.js +0 -1
  58. package/src/_internals/_isInteger.js +0 -5
  59. package/src/_internals/_keys.js +0 -1
package/dist/rambda.js CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ function F() {
6
+ return false;
7
+ }
8
+
9
+ function T() {
10
+ return true;
11
+ }
12
+
5
13
  function add(a, b) {
6
14
  if (arguments.length === 1) return _b => add(a, _b);
7
15
  return Number(a) + Number(b);
@@ -105,7 +113,9 @@ function apply(fn, args) {
105
113
  return fn.apply(this, args);
106
114
  }
107
115
 
108
- const _isArray = Array.isArray;
116
+ const {
117
+ isArray
118
+ } = Array;
109
119
 
110
120
  function __findHighestArity(spec, max = 0) {
111
121
  for (const key in spec) {
@@ -145,13 +155,13 @@ function __applySpecWithArity(spec, arity, cache) {
145
155
  if (remaining === 4) return (x, y, z, a) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, x, y, z, a));
146
156
  if (remaining > 4) return (...args) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, ...args));
147
157
 
148
- if (_isArray(spec)) {
158
+ if (isArray(spec)) {
149
159
  const ret = [];
150
160
  let i = 0;
151
161
  const l = spec.length;
152
162
 
153
163
  for (; i < l; i++) {
154
- if (typeof spec[i] === 'object' || _isArray(spec[i])) {
164
+ if (typeof spec[i] === 'object' || isArray(spec[i])) {
155
165
  ret[i] = __applySpecWithArity(spec[i], arity, cache);
156
166
  }
157
167
 
@@ -204,10 +214,11 @@ const assoc = curry(assocFn);
204
214
  function _isInteger(n) {
205
215
  return n << 0 === n;
206
216
  }
207
- var _isInteger$1 = Number.isInteger || _isInteger;
217
+
218
+ const isInteger = Number.isInteger || _isInteger;
208
219
 
209
220
  function assocPathFn(path, newValue, input) {
210
- const pathArrValue = typeof path === 'string' ? path.split('.').map(x => _isInteger(Number(x)) ? Number(x) : x) : path;
221
+ const pathArrValue = typeof path === 'string' ? path.split('.').map(x => isInteger(Number(x)) ? Number(x) : x) : path;
211
222
 
212
223
  if (pathArrValue.length === 0) {
213
224
  return newValue;
@@ -217,11 +228,11 @@ function assocPathFn(path, newValue, input) {
217
228
 
218
229
  if (pathArrValue.length > 1) {
219
230
  const condition = typeof input !== 'object' || input === null || !input.hasOwnProperty(index);
220
- const nextinput = condition ? _isInteger(pathArrValue[1]) ? [] : {} : input[index];
221
- newValue = assocPathFn(Array.prototype.slice.call(pathArrValue, 1), newValue, nextinput);
231
+ const nextInput = condition ? isInteger(pathArrValue[1]) ? [] : {} : input[index];
232
+ newValue = assocPathFn(Array.prototype.slice.call(pathArrValue, 1), newValue, nextInput);
222
233
  }
223
234
 
224
- if (_isInteger(index) && _isArray(input)) {
235
+ if (isInteger(index) && isArray(input)) {
225
236
  const arr = cloneList(input);
226
237
  arr[index] = newValue;
227
238
  return arr;
@@ -358,7 +369,7 @@ function clampFn(min, max, input) {
358
369
  const clamp = curry(clampFn);
359
370
 
360
371
  function clone(input) {
361
- const out = _isArray(input) ? Array(input.length) : {};
372
+ const out = isArray(input) ? Array(input.length) : {};
362
373
  if (input && input.getTime) return new Date(input.getTime());
363
374
 
364
375
  for (const key in input) {
@@ -373,8 +384,6 @@ function complement(fn) {
373
384
  return (...input) => !fn(...input);
374
385
  }
375
386
 
376
- const _keys = Object.keys;
377
-
378
387
  class ReduceStopper {
379
388
  constructor(value) {
380
389
  this.value = value;
@@ -383,7 +392,7 @@ class ReduceStopper {
383
392
  }
384
393
 
385
394
  function reduceFn(reducer, acc, list) {
386
- if (!_isArray(list)) {
395
+ if (!isArray(list)) {
387
396
  throw new TypeError('reduce: list must be array or iterable');
388
397
  }
389
398
 
@@ -506,6 +515,10 @@ function cond(conditions) {
506
515
  };
507
516
  }
508
517
 
518
+ const {
519
+ keys: keys$1
520
+ } = Object;
521
+
509
522
  function mapArray(fn, list, isIndexed = false) {
510
523
  let index = 0;
511
524
  const willReturn = Array(list.length);
@@ -523,14 +536,12 @@ function mapObject(fn, obj) {
523
536
  }
524
537
 
525
538
  let index = 0;
526
-
527
- const keys = _keys(obj);
528
-
529
- const len = keys.length;
539
+ const objKeys = keys$1(obj);
540
+ const len = objKeys.length;
530
541
  const willReturn = {};
531
542
 
532
543
  while (index < len) {
533
- const key = keys[index];
544
+ const key = objKeys[index];
534
545
  willReturn[key] = fn(obj[key], key, obj);
535
546
  index++;
536
547
  }
@@ -542,10 +553,10 @@ function map(fn, iterable) {
542
553
  if (arguments.length === 1) return _iterable => map(fn, _iterable);
543
554
 
544
555
  if (!iterable) {
545
- throw new Error('Incorrect iterable input');
556
+ throw new Error(INCORRECT_ITERABLE_INPUT);
546
557
  }
547
558
 
548
- if (_isArray(iterable)) return mapArray(fn, iterable);
559
+ if (isArray(iterable)) return mapArray(fn, iterable);
549
560
  return mapObject(fn, iterable);
550
561
  }
551
562
 
@@ -567,7 +578,7 @@ function count(predicate, list) {
567
578
  return _list => count(predicate, _list);
568
579
  }
569
580
 
570
- if (!_isArray(list)) return 0;
581
+ if (!isArray(list)) return 0;
571
582
  return list.filter(x => predicate(x)).length;
572
583
  }
573
584
 
@@ -617,7 +628,7 @@ function type(input) {
617
628
  }
618
629
 
619
630
  function _lastIndexOf(valueToFind, list) {
620
- if (!_isArray(list)) {
631
+ if (!isArray(list)) {
621
632
  throw new Error(`Cannot read property 'indexOf' of ${list}`);
622
633
  }
623
634
 
@@ -638,7 +649,7 @@ function _lastIndexOf(valueToFind, list) {
638
649
  return foundIndex;
639
650
  }
640
651
  function _indexOf(valueToFind, list) {
641
- if (!_isArray(list)) {
652
+ if (!isArray(list)) {
642
653
  throw new Error(`Cannot read property 'indexOf' of ${list}`);
643
654
  }
644
655
 
@@ -799,7 +810,7 @@ function includes(valueToFind, iterable) {
799
810
  throw new TypeError(`Cannot read property \'indexOf\' of ${iterable}`);
800
811
  }
801
812
 
802
- if (!_isArray(iterable)) return false;
813
+ if (!isArray(iterable)) return false;
803
814
  return _indexOf(valueToFind, iterable) > -1;
804
815
  }
805
816
 
@@ -895,14 +906,13 @@ function dropLastWhile(predicate, iterable) {
895
906
  }
896
907
 
897
908
  if (iterable.length === 0) return iterable;
898
-
899
- const isArray = _isArray(iterable);
909
+ const isArray$1 = isArray(iterable);
900
910
 
901
911
  if (typeof predicate !== 'function') {
902
912
  throw new Error(`'predicate' is from wrong type ${typeof predicate}`);
903
913
  }
904
914
 
905
- if (!isArray && typeof iterable !== 'string') {
915
+ if (!isArray$1 && typeof iterable !== 'string') {
906
916
  throw new Error(`'iterable' is from wrong type ${typeof iterable}`);
907
917
  }
908
918
 
@@ -921,11 +931,11 @@ function dropLastWhile(predicate, iterable) {
921
931
  }
922
932
  }
923
933
 
924
- return isArray ? toReturn.reverse() : toReturn.reverse().join('');
934
+ return isArray$1 ? toReturn.reverse() : toReturn.reverse().join('');
925
935
  }
926
936
 
927
937
  function dropRepeats(list) {
928
- if (!_isArray(list)) {
938
+ if (!isArray(list)) {
929
939
  throw new Error(`${list} is not a list`);
930
940
  }
931
941
 
@@ -945,7 +955,7 @@ function dropRepeatsWith(predicate, list) {
945
955
  return _iterable => dropRepeatsWith(predicate, _iterable);
946
956
  }
947
957
 
948
- if (!_isArray(list)) {
958
+ if (!isArray(list)) {
949
959
  throw new Error(`${list} is not a list`);
950
960
  }
951
961
 
@@ -970,9 +980,9 @@ function dropWhile(predicate, iterable) {
970
980
  return _iterable => dropWhile(predicate, _iterable);
971
981
  }
972
982
 
973
- const isArray = _isArray(iterable);
983
+ const isArray$1 = isArray(iterable);
974
984
 
975
- if (!isArray && typeof iterable !== 'string') {
985
+ if (!isArray$1 && typeof iterable !== 'string') {
976
986
  throw new Error('`iterable` is neither list nor a string');
977
987
  }
978
988
 
@@ -989,7 +999,7 @@ function dropWhile(predicate, iterable) {
989
999
  }
990
1000
  }
991
1001
 
992
- return isArray ? holder : holder.join('');
1002
+ return isArray$1 ? holder : holder.join('');
993
1003
  }
994
1004
 
995
1005
  function either(firstPredicate, secondPredicate) {
@@ -1007,7 +1017,7 @@ function endsWith(target, iterable) {
1007
1017
  return iterable.endsWith(target);
1008
1018
  }
1009
1019
 
1010
- if (!_isArray(target)) return false;
1020
+ if (!isArray(target)) return false;
1011
1021
  const diff = iterable.length - target.length;
1012
1022
  let correct = true;
1013
1023
  const filtered = target.filter((x, index) => {
@@ -1086,10 +1096,6 @@ function evolve(rules, iterable) {
1086
1096
  return evolveArray(rules, iterable);
1087
1097
  }
1088
1098
 
1089
- function F() {
1090
- return false;
1091
- }
1092
-
1093
1099
  function filterObject(predicate, obj) {
1094
1100
  const willReturn = {};
1095
1101
 
@@ -1125,7 +1131,7 @@ function filter(predicate, iterable) {
1125
1131
  throw new Error('Incorrect iterable input');
1126
1132
  }
1127
1133
 
1128
- if (_isArray(iterable)) return filterArray(predicate, iterable, false);
1134
+ if (isArray(iterable)) return filterArray(predicate, iterable, false);
1129
1135
  return filterObject(predicate, iterable);
1130
1136
  }
1131
1137
 
@@ -1189,7 +1195,7 @@ function flatten(list, input) {
1189
1195
  const willReturn = input === undefined ? [] : input;
1190
1196
 
1191
1197
  for (let i = 0; i < list.length; i++) {
1192
- if (_isArray(list[i])) {
1198
+ if (isArray(list[i])) {
1193
1199
  flatten(list[i], willReturn);
1194
1200
  } else {
1195
1201
  willReturn.push(list[i]);
@@ -1226,7 +1232,7 @@ function forEach(fn, list) {
1226
1232
  return;
1227
1233
  }
1228
1234
 
1229
- if (_isArray(list)) {
1235
+ if (isArray(list)) {
1230
1236
  let index = 0;
1231
1237
  const len = list.length;
1232
1238
 
@@ -1236,13 +1242,11 @@ function forEach(fn, list) {
1236
1242
  }
1237
1243
  } else {
1238
1244
  let index = 0;
1239
-
1240
- const keys = _keys(list);
1241
-
1242
- const len = keys.length;
1245
+ const listKeys = keys$1(list);
1246
+ const len = listKeys.length;
1243
1247
 
1244
1248
  while (index < len) {
1245
- const key = keys[index];
1249
+ const key = listKeys[index];
1246
1250
  fn(list[key], key, list);
1247
1251
  index++;
1248
1252
  }
@@ -1276,7 +1280,7 @@ function groupBy(groupFn, list) {
1276
1280
  }
1277
1281
 
1278
1282
  function groupWith(compareFn, list) {
1279
- if (!_isArray(list)) throw new TypeError('list.reduce is not a function');
1283
+ if (!isArray(list)) throw new TypeError('list.reduce is not a function');
1280
1284
  const clone = cloneList(list);
1281
1285
  if (list.length === 1) return [clone];
1282
1286
  const toReturn = [];
@@ -1362,11 +1366,12 @@ function _objectIs(a, b) {
1362
1366
 
1363
1367
  return a !== a && b !== b;
1364
1368
  }
1365
- var _objectIs$1 = Object.is || _objectIs;
1369
+
1370
+ const objectIs = Object.is || _objectIs;
1366
1371
 
1367
1372
  function identical(a, b) {
1368
1373
  if (arguments.length === 1) return _b => identical(a, _b);
1369
- return _objectIs$1(a, b);
1374
+ return objectIs(a, b);
1370
1375
  }
1371
1376
 
1372
1377
  function identity(x) {
@@ -1531,7 +1536,7 @@ function lastIndexOf(valueToFind, list) {
1531
1536
  }
1532
1537
 
1533
1538
  function length(x) {
1534
- if (_isArray(x)) return x.length;
1539
+ if (isArray(x)) return x.length;
1535
1540
  if (typeof x === 'string') return x.length;
1536
1541
  return NaN;
1537
1542
  }
@@ -1555,7 +1560,6 @@ function updateFn(index, newValue, list) {
1555
1560
  if (index === -1) return clone.fill(newValue, index);
1556
1561
  return clone.fill(newValue, index, index + 1);
1557
1562
  }
1558
-
1559
1563
  const update = curry(updateFn);
1560
1564
 
1561
1565
  function lensIndex(index) {
@@ -1578,7 +1582,7 @@ function match(pattern, input) {
1578
1582
 
1579
1583
  function mathMod(x, y) {
1580
1584
  if (arguments.length === 1) return _y => mathMod(x, _y);
1581
- if (!_isInteger$1(x) || !_isInteger$1(y) || y < 1) return NaN;
1585
+ if (!isInteger(x) || !isInteger(y) || y < 1) return NaN;
1582
1586
  return (x % y + y) % y;
1583
1587
  }
1584
1588
 
@@ -1624,7 +1628,7 @@ function mergeDeepRight(target, source) {
1624
1628
  return sourceHolder => mergeDeepRight(target, sourceHolder);
1625
1629
  }
1626
1630
 
1627
- const willReturn = JSON.parse(JSON.stringify(target));
1631
+ const willReturn = clone(target);
1628
1632
  Object.keys(source).forEach(key => {
1629
1633
  if (type(source[key]) === 'Object') {
1630
1634
  if (type(target[key]) === 'Object') {
@@ -1718,6 +1722,25 @@ function _defineProperty(obj, key, value) {
1718
1722
  return obj;
1719
1723
  }
1720
1724
 
1725
+ function isIterable(input) {
1726
+ return Array.isArray(input) || type(input) === 'Object';
1727
+ }
1728
+
1729
+ function modifyFn(property, fn, iterable) {
1730
+ if (!isIterable(iterable)) return iterable;
1731
+ if (iterable[property] === undefined) return iterable;
1732
+
1733
+ if (isArray(iterable)) {
1734
+ return updateFn(property, fn(iterable[property]), iterable);
1735
+ }
1736
+
1737
+ return _objectSpread2(_objectSpread2({}, iterable), {}, {
1738
+ [property]: fn(iterable[property])
1739
+ });
1740
+ }
1741
+
1742
+ const modify = curry(modifyFn);
1743
+
1721
1744
  function modifyPathFn(pathInput, fn, object) {
1722
1745
  const path$1 = createPath(pathInput);
1723
1746
 
@@ -1874,15 +1897,7 @@ function partial(fn, ...args) {
1874
1897
  }
1875
1898
 
1876
1899
  function partialObject(fn, input) {
1877
- return rest => {
1878
- if (type(fn) === 'Async') {
1879
- return new Promise((resolve, reject) => {
1880
- fn(mergeDeepRight(rest, input)).then(resolve).catch(reject);
1881
- });
1882
- }
1883
-
1884
- return fn(mergeDeepRight(rest, input));
1885
- };
1900
+ return nextInput => fn(mergeDeepRight(nextInput, input));
1886
1901
  }
1887
1902
 
1888
1903
  function partitionObject(predicate, iterable) {
@@ -1917,7 +1932,7 @@ function partition(predicate, iterable) {
1917
1932
  return listHolder => partition(predicate, listHolder);
1918
1933
  }
1919
1934
 
1920
- if (!_isArray(iterable)) return partitionObject(predicate, iterable);
1935
+ if (!isArray(iterable)) return partitionObject(predicate, iterable);
1921
1936
  return partitionArray(predicate, iterable);
1922
1937
  }
1923
1938
 
@@ -2026,24 +2041,24 @@ function propOrFn(defaultValue, property, obj) {
2026
2041
 
2027
2042
  const propOr = curry(propOrFn);
2028
2043
 
2044
+ function propSatisfiesFn(predicate, property, obj) {
2045
+ return predicate(prop(property, obj));
2046
+ }
2047
+
2048
+ const propSatisfies = curry(propSatisfiesFn);
2049
+
2029
2050
  function props(propsToPick, obj) {
2030
2051
  if (arguments.length === 1) {
2031
2052
  return _obj => props(propsToPick, _obj);
2032
2053
  }
2033
2054
 
2034
- if (!_isArray(propsToPick)) {
2055
+ if (!isArray(propsToPick)) {
2035
2056
  throw new Error('propsToPick is not a list');
2036
2057
  }
2037
2058
 
2038
2059
  return mapArray(prop => obj[prop], propsToPick);
2039
2060
  }
2040
2061
 
2041
- function propSatisfiesFn(predicate, property, obj) {
2042
- return predicate(prop(property, obj));
2043
- }
2044
-
2045
- const propSatisfies = curry(propSatisfiesFn);
2046
-
2047
2062
  function range(start, end) {
2048
2063
  if (arguments.length === 1) return _end => range(start, _end);
2049
2064
 
@@ -2142,7 +2157,7 @@ function splitAt(index, input) {
2142
2157
  }
2143
2158
 
2144
2159
  if (!input) throw new TypeError(`Cannot read property 'slice' of ${input}`);
2145
- if (!_isArray(input) && typeof input !== 'string') return [[], []];
2160
+ if (!isArray(input) && typeof input !== 'string') return [[], []];
2146
2161
  const correctIndex = maybe(index < 0, input.length + index < 0 ? 0 : input.length + index, index);
2147
2162
  return [take(correctIndex, input), drop(correctIndex, input)];
2148
2163
  }
@@ -2198,7 +2213,7 @@ function startsWith(target, iterable) {
2198
2213
  return iterable.startsWith(target);
2199
2214
  }
2200
2215
 
2201
- if (!_isArray(target)) return false;
2216
+ if (!isArray(target)) return false;
2202
2217
  let correct = true;
2203
2218
  const filtered = target.filter((x, index) => {
2204
2219
  if (!correct) return false;
@@ -2222,10 +2237,6 @@ function symmetricDifference(x, y) {
2222
2237
  return concat(filter(value => !includes(value, y), x), filter(value => !includes(value, x), y));
2223
2238
  }
2224
2239
 
2225
- function T() {
2226
- return true;
2227
- }
2228
-
2229
2240
  function tail(listOrString) {
2230
2241
  return drop(1, listOrString);
2231
2242
  }
@@ -2260,7 +2271,7 @@ function takeLastWhile(predicate, input) {
2260
2271
  }
2261
2272
  }
2262
2273
 
2263
- return _isArray(input) ? toReturn.reverse() : toReturn.reverse().join('');
2274
+ return isArray(input) ? toReturn.reverse() : toReturn.reverse().join('');
2264
2275
  }
2265
2276
 
2266
2277
  function takeWhile(predicate, iterable) {
@@ -2268,9 +2279,9 @@ function takeWhile(predicate, iterable) {
2268
2279
  return _iterable => takeWhile(predicate, _iterable);
2269
2280
  }
2270
2281
 
2271
- const isArray = _isArray(iterable);
2282
+ const isArray$1 = isArray(iterable);
2272
2283
 
2273
- if (!isArray && typeof iterable !== 'string') {
2284
+ if (!isArray$1 && typeof iterable !== 'string') {
2274
2285
  throw new Error('`iterable` is neither list nor a string');
2275
2286
  }
2276
2287
 
@@ -2285,7 +2296,7 @@ function takeWhile(predicate, iterable) {
2285
2296
  holder.push(iterable[counter]);
2286
2297
  }
2287
2298
  }
2288
- return isArray ? holder : holder.join('');
2299
+ return isArray$1 ? holder : holder.join('');
2289
2300
  }
2290
2301
 
2291
2302
  function tap(fn, x) {
@@ -2307,7 +2318,7 @@ function test(pattern, str) {
2307
2318
  function times(fn, howMany) {
2308
2319
  if (arguments.length === 1) return _howMany => times(fn, _howMany);
2309
2320
 
2310
- if (!Number.isInteger(howMany) || howMany < 0) {
2321
+ if (!isInteger(howMany) || howMany < 0) {
2311
2322
  throw new RangeError('n must be an integer');
2312
2323
  }
2313
2324
 
@@ -2332,7 +2343,7 @@ function toUpper(str) {
2332
2343
 
2333
2344
  function transpose(array) {
2334
2345
  return array.reduce((acc, el) => {
2335
- el.forEach((nestedEl, i) => _isArray(acc[i]) ? acc[i].push(nestedEl) : acc.push([nestedEl]));
2346
+ el.forEach((nestedEl, i) => isArray(acc[i]) ? acc[i].push(nestedEl) : acc.push([nestedEl]));
2336
2347
  return acc;
2337
2348
  }, []);
2338
2349
  }
@@ -2430,7 +2441,7 @@ function unwind(property, obj) {
2430
2441
  return _obj => unwind(property, _obj);
2431
2442
  }
2432
2443
 
2433
- if (!_isArray(obj[property])) return [obj];
2444
+ if (!isArray(obj[property])) return [obj];
2434
2445
  return mapArray(x => _objectSpread2(_objectSpread2({}, obj), {}, {
2435
2446
  [property]: x
2436
2447
  }), obj[property]);
@@ -2466,6 +2477,7 @@ function where(conditions, input) {
2466
2477
  let flag = true;
2467
2478
 
2468
2479
  for (const prop in conditions) {
2480
+ if (!flag) continue;
2469
2481
  const result = conditions[prop](input[prop]);
2470
2482
 
2471
2483
  if (flag && result === false) {
@@ -2649,6 +2661,7 @@ exports.mergeWith = mergeWith;
2649
2661
  exports.min = min;
2650
2662
  exports.minBy = minBy;
2651
2663
  exports.minByFn = minByFn;
2664
+ exports.modify = modify;
2652
2665
  exports.modifyPath = modifyPath;
2653
2666
  exports.modifyPathFn = modifyPathFn;
2654
2667
  exports.modulo = modulo;
@@ -2730,6 +2743,7 @@ exports.uniqWith = uniqWith;
2730
2743
  exports.unless = unless;
2731
2744
  exports.unwind = unwind;
2732
2745
  exports.update = update;
2746
+ exports.updateFn = updateFn;
2733
2747
  exports.values = values;
2734
2748
  exports.view = view;
2735
2749
  exports.when = when;