rambda 9.4.2 → 10.0.0-alpha.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 (257) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/README.md +4637 -13433
  3. package/dist/rambda.esm.js +1487 -0
  4. package/dist/rambda.js +952 -2113
  5. package/dist/rambda.umd.js +1595 -1
  6. package/immutable.d.ts +1066 -1293
  7. package/index.d.ts +1066 -1293
  8. package/package.json +95 -94
  9. package/rambda.js +10 -138
  10. package/src/_internals/baseSlice.js +5 -7
  11. package/src/_internals/createPath.js +4 -6
  12. package/src/_internals/includes.js +8 -4
  13. package/src/_internals/set.js +11 -11
  14. package/src/all.js +8 -6
  15. package/src/allPass.js +4 -4
  16. package/src/any.js +10 -10
  17. package/src/anyPass.js +4 -4
  18. package/src/append.js +4 -6
  19. package/src/checkObjectWithSpec.js +16 -0
  20. package/src/complement.js +1 -1
  21. package/src/concat.js +2 -4
  22. package/src/count.js +5 -4
  23. package/src/countBy.js +6 -7
  24. package/src/defaultTo.js +4 -6
  25. package/src/drop.js +4 -2
  26. package/src/dropLast.js +4 -8
  27. package/src/dropLastWhile.js +17 -26
  28. package/src/dropWhile.js +14 -22
  29. package/src/eqBy.js +3 -8
  30. package/src/eqProps.js +3 -8
  31. package/src/equals.js +99 -58
  32. package/src/evolve.js +19 -52
  33. package/src/excludes.js +5 -0
  34. package/src/filter.js +10 -40
  35. package/src/filterObject.js +13 -0
  36. package/src/find.js +6 -6
  37. package/src/findIndex.js +5 -5
  38. package/src/findLast.js +6 -6
  39. package/src/findLastIndex.js +5 -5
  40. package/src/flatMap.js +3 -0
  41. package/src/flatten.js +5 -5
  42. package/src/groupBy.js +9 -7
  43. package/src/head.js +5 -3
  44. package/src/includes.js +10 -7
  45. package/src/indexOf.js +2 -6
  46. package/src/init.js +6 -8
  47. package/src/innerJoin.js +11 -19
  48. package/src/intersection.js +2 -4
  49. package/src/intersperse.js +7 -7
  50. package/src/join.js +2 -4
  51. package/src/last.js +4 -4
  52. package/src/lastIndexOf.js +2 -6
  53. package/src/map.js +9 -49
  54. package/src/mapAsync.js +11 -0
  55. package/src/mapObject.js +18 -0
  56. package/src/mapObjectAsync.js +10 -0
  57. package/src/match.js +6 -6
  58. package/src/maxBy.js +2 -8
  59. package/src/merge.js +4 -1
  60. package/src/mergeTypes.js +3 -0
  61. package/src/minBy.js +2 -8
  62. package/src/modifyPath.js +22 -25
  63. package/src/none.js +8 -6
  64. package/src/objOf.js +2 -6
  65. package/src/omit.js +26 -11
  66. package/src/partition.js +20 -23
  67. package/src/path.js +14 -15
  68. package/src/pick.js +15 -15
  69. package/src/pipe.js +70 -13
  70. package/src/pipeAsync.js +10 -0
  71. package/src/pluck.js +7 -9
  72. package/src/prepend.js +2 -6
  73. package/src/prop.js +2 -10
  74. package/src/propEq.js +8 -10
  75. package/src/propOr.js +7 -8
  76. package/src/propSatisfies.js +2 -7
  77. package/src/range.js +3 -3
  78. package/src/reduce.js +15 -30
  79. package/src/reject.js +2 -4
  80. package/src/replace.js +2 -8
  81. package/src/replaceItemAtIndex.js +15 -0
  82. package/src/sort.js +2 -4
  83. package/src/sortBy.js +3 -3
  84. package/src/sortWith.js +9 -13
  85. package/src/split.js +2 -4
  86. package/src/splitEvery.js +6 -8
  87. package/src/symmetricDifference.js +5 -8
  88. package/src/tail.js +2 -2
  89. package/src/take.js +11 -9
  90. package/src/takeLast.js +14 -14
  91. package/src/takeLastWhile.js +19 -20
  92. package/src/takeWhile.js +12 -21
  93. package/src/tap.js +3 -3
  94. package/src/test.js +2 -8
  95. package/src/tryCatch.js +5 -14
  96. package/src/type.js +6 -5
  97. package/src/union.js +10 -8
  98. package/src/uniq.js +2 -2
  99. package/src/uniqBy.js +5 -6
  100. package/src/uniqWith.js +10 -14
  101. package/src/unless.js +7 -9
  102. package/src/unwind.js +6 -14
  103. package/src/update.js +8 -11
  104. package/src/when.js +7 -9
  105. package/src/zip.js +8 -8
  106. package/src/zipWith.js +5 -7
  107. package/src/F.js +0 -3
  108. package/src/T.js +0 -3
  109. package/src/_internals/_arity.js +0 -64
  110. package/src/_internals/compare.js +0 -3
  111. package/src/_internals/constants.js +0 -1
  112. package/src/_internals/createPathInput.js +0 -7
  113. package/src/_internals/isFalsy.js +0 -13
  114. package/src/_internals/isInteger.js +0 -10
  115. package/src/_internals/isIterable.js +0 -5
  116. package/src/_internals/isObject.js +0 -5
  117. package/src/_internals/isTruthy.js +0 -13
  118. package/src/_internals/objectIs.js +0 -9
  119. package/src/_internals/utils.js +0 -21
  120. package/src/add.js +0 -5
  121. package/src/addIndex.js +0 -23
  122. package/src/addIndexRight.js +0 -9
  123. package/src/adjust.js +0 -16
  124. package/src/always.js +0 -3
  125. package/src/and.js +0 -5
  126. package/src/ap.js +0 -7
  127. package/src/aperture.js +0 -15
  128. package/src/apply.js +0 -7
  129. package/src/applySpec.js +0 -132
  130. package/src/applyTo.js +0 -7
  131. package/src/ascend.js +0 -23
  132. package/src/assoc.js +0 -11
  133. package/src/assocPath.js +0 -46
  134. package/src/binary.js +0 -5
  135. package/src/bind.js +0 -9
  136. package/src/both.js +0 -5
  137. package/src/call.js +0 -1
  138. package/src/chain.js +0 -7
  139. package/src/clamp.js +0 -15
  140. package/src/clone.js +0 -18
  141. package/src/collectBy.js +0 -27
  142. package/src/comparator.js +0 -5
  143. package/src/compose.js +0 -9
  144. package/src/composeWith.js +0 -33
  145. package/src/cond.js +0 -14
  146. package/src/converge.js +0 -18
  147. package/src/curry.js +0 -7
  148. package/src/curryN.js +0 -40
  149. package/src/dec.js +0 -1
  150. package/src/descend.js +0 -17
  151. package/src/difference.js +0 -8
  152. package/src/differenceWith.js +0 -20
  153. package/src/dissoc.js +0 -13
  154. package/src/dissocPath.js +0 -47
  155. package/src/divide.js +0 -5
  156. package/src/dropRepeats.js +0 -20
  157. package/src/dropRepeatsBy.js +0 -21
  158. package/src/dropRepeatsWith.js +0 -28
  159. package/src/either.js +0 -8
  160. package/src/empty.js +0 -15
  161. package/src/endsWith.js +0 -23
  162. package/src/flip.js +0 -23
  163. package/src/forEach.js +0 -19
  164. package/src/forEachObjIndexed.js +0 -24
  165. package/src/fromPairs.js +0 -6
  166. package/src/groupWith.js +0 -46
  167. package/src/gt.js +0 -6
  168. package/src/gte.js +0 -6
  169. package/src/has.js +0 -7
  170. package/src/hasIn.js +0 -9
  171. package/src/hasPath.js +0 -9
  172. package/src/identical.js +0 -7
  173. package/src/identity.js +0 -3
  174. package/src/ifElse.js +0 -17
  175. package/src/inc.js +0 -1
  176. package/src/indexBy.js +0 -29
  177. package/src/insert.js +0 -11
  178. package/src/insertAll.js +0 -7
  179. package/src/is.js +0 -8
  180. package/src/isEmpty.js +0 -18
  181. package/src/isNil.js +0 -3
  182. package/src/isNotEmpty.js +0 -5
  183. package/src/isNotNil.js +0 -3
  184. package/src/isPromise.js +0 -5
  185. package/src/juxt.js +0 -3
  186. package/src/keys.js +0 -3
  187. package/src/length.js +0 -8
  188. package/src/lens.js +0 -7
  189. package/src/lensIndex.js +0 -7
  190. package/src/lensPath.js +0 -7
  191. package/src/lensProp.js +0 -7
  192. package/src/lt.js +0 -6
  193. package/src/lte.js +0 -6
  194. package/src/mathMod.js +0 -8
  195. package/src/max.js +0 -5
  196. package/src/maybe.js +0 -13
  197. package/src/mean.js +0 -5
  198. package/src/median.js +0 -17
  199. package/src/mergeAll.js +0 -11
  200. package/src/mergeDeepLeft.js +0 -5
  201. package/src/mergeDeepRight.js +0 -24
  202. package/src/mergeLeft.js +0 -7
  203. package/src/mergeRight.js +0 -8
  204. package/src/mergeWith.js +0 -25
  205. package/src/min.js +0 -5
  206. package/src/modify.js +0 -23
  207. package/src/modulo.js +0 -5
  208. package/src/move.js +0 -19
  209. package/src/multiply.js +0 -5
  210. package/src/negate.js +0 -3
  211. package/src/not.js +0 -3
  212. package/src/nth.js +0 -9
  213. package/src/of.js +0 -3
  214. package/src/on.js +0 -16
  215. package/src/once.js +0 -24
  216. package/src/or.js +0 -5
  217. package/src/over.js +0 -14
  218. package/src/partial.js +0 -17
  219. package/src/partialObject.js +0 -5
  220. package/src/pathEq.js +0 -11
  221. package/src/pathOr.js +0 -11
  222. package/src/pathSatisfies.js +0 -9
  223. package/src/paths.js +0 -9
  224. package/src/pickAll.js +0 -23
  225. package/src/pickBy.js +0 -11
  226. package/src/product.js +0 -4
  227. package/src/propIs.js +0 -10
  228. package/src/props.js +0 -13
  229. package/src/reduceBy.js +0 -29
  230. package/src/removeIndex.js +0 -7
  231. package/src/repeat.js +0 -7
  232. package/src/reverse.js +0 -9
  233. package/src/set.js +0 -9
  234. package/src/slice.js +0 -9
  235. package/src/splitAt.js +0 -21
  236. package/src/splitWhen.js +0 -25
  237. package/src/startsWith.js +0 -23
  238. package/src/subtract.js +0 -5
  239. package/src/sum.js +0 -3
  240. package/src/swap.js +0 -42
  241. package/src/times.js +0 -12
  242. package/src/toLower.js +0 -3
  243. package/src/toPairs.js +0 -3
  244. package/src/toString.js +0 -3
  245. package/src/toUpper.js +0 -3
  246. package/src/transpose.js +0 -10
  247. package/src/trim.js +0 -3
  248. package/src/unapply.js +0 -5
  249. package/src/unnest.js +0 -9
  250. package/src/values.js +0 -6
  251. package/src/view.js +0 -10
  252. package/src/where.js +0 -15
  253. package/src/whereAny.js +0 -12
  254. package/src/whereEq.js +0 -14
  255. package/src/without.js +0 -15
  256. package/src/xor.js +0 -5
  257. package/src/zipObj.js +0 -13
@@ -0,0 +1,1487 @@
1
+ function all(predicate) {
2
+ return list => {
3
+ for (let i = 0; i < list.length; i++) {
4
+ if (!predicate(list[i])) {
5
+ return false
6
+ }
7
+ }
8
+
9
+ return true
10
+ }
11
+ }
12
+
13
+ function allPass(predicates) {
14
+ return input => {
15
+ let counter = 0;
16
+ while (counter < predicates.length) {
17
+ if (!predicates[counter](input)) {
18
+ return false
19
+ }
20
+ counter++;
21
+ }
22
+
23
+ return true
24
+ }
25
+ }
26
+
27
+ function any(predicate) {
28
+ return list => {
29
+ let counter = 0;
30
+ while (counter < list.length) {
31
+ if (predicate(list[counter], counter)) {
32
+ return true
33
+ }
34
+ counter++;
35
+ }
36
+
37
+ return false
38
+ }
39
+ }
40
+
41
+ function anyPass(predicates) {
42
+ return input => {
43
+ let counter = 0;
44
+ while (counter < predicates.length) {
45
+ if (predicates[counter](input)) {
46
+ return true
47
+ }
48
+ counter++;
49
+ }
50
+
51
+ return false
52
+ }
53
+ }
54
+
55
+ const cloneList = list => Array.prototype.slice.call(list);
56
+
57
+ function append(x) {
58
+ return list=> {
59
+ const clone = cloneList(list);
60
+ clone.push(x);
61
+
62
+ return clone
63
+ }
64
+ }
65
+
66
+ function checkObjectWithSpec(conditions) {
67
+ return input => {
68
+ let shouldProceed = true;
69
+ for (const prop in conditions) {
70
+ if (!shouldProceed) {
71
+ continue
72
+ }
73
+ const result = conditions[prop](input[prop]);
74
+ if (shouldProceed && result === false) {
75
+ shouldProceed = false;
76
+ }
77
+ }
78
+
79
+ return shouldProceed
80
+ }
81
+ }
82
+
83
+ function complement(fn) {
84
+ return (...input) => !fn(...input)
85
+ }
86
+
87
+ function concat(x) {
88
+ return y => typeof x === 'string' ? `${x}${y}` : [...x, ...y]
89
+ }
90
+
91
+ const { isArray } = Array;
92
+
93
+ function count(predicate, ) {
94
+ return list => {
95
+ if (!isArray(list)) {
96
+ return 0
97
+ }
98
+
99
+ return list.filter(x => predicate(x)).length
100
+ }
101
+ }
102
+
103
+ function countBy(fn) {
104
+ return list => {
105
+ const willReturn = {};
106
+
107
+ list.forEach(item => {
108
+ const key = fn(item);
109
+ if (!willReturn[key]) {
110
+ willReturn[key] = 1;
111
+ } else {
112
+ willReturn[key]++;
113
+ }
114
+ });
115
+
116
+ return willReturn
117
+ }
118
+ }
119
+
120
+ function isFalsy(input) {
121
+ return input === undefined || input === null || Number.isNaN(input) === true
122
+ }
123
+
124
+ function defaultTo(defaultArgument, input) {
125
+ if (arguments.length === 1) {
126
+ return _input => defaultTo(defaultArgument, _input)
127
+ }
128
+
129
+ return isFalsy(input) ? defaultArgument : input
130
+ }
131
+
132
+ function drop(howManyToDrop, listOrString) {
133
+ if (arguments.length === 1) {
134
+ return _list => drop(howManyToDrop, _list)
135
+ }
136
+
137
+ return listOrString.slice(howManyToDrop > 0 ? howManyToDrop : 0)
138
+ }
139
+
140
+ function dropLast(numberItems) {
141
+ return list => numberItems > 0
142
+ ? list.slice(0, -numberItems)
143
+ : list.slice()
144
+ }
145
+
146
+ function dropLastWhile(predicate) {
147
+ return list => {
148
+ if (list.length === 0) {
149
+ return list
150
+ }
151
+
152
+ const toReturn = [];
153
+ let counter = list.length;
154
+
155
+ while (counter) {
156
+ const item = list[--counter];
157
+ if (!predicate(item, counter)) {
158
+ toReturn.push(item);
159
+ break
160
+ }
161
+ }
162
+
163
+ while (counter) {
164
+ toReturn.push(list[--counter]);
165
+ }
166
+
167
+ return toReturn.reverse()
168
+ }
169
+ }
170
+
171
+ function dropWhile(predicate) {
172
+ return iterable => {
173
+ const toReturn = [];
174
+ let counter = 0;
175
+
176
+ while (counter < iterable.length) {
177
+ const item = iterable[counter++];
178
+ if (!predicate(item, counter)) {
179
+ toReturn.push(item);
180
+ break
181
+ }
182
+ }
183
+
184
+ while (counter < iterable.length) {
185
+ toReturn.push(iterable[counter++]);
186
+ }
187
+
188
+ return toReturn
189
+ }
190
+ }
191
+
192
+ function type(input) {
193
+ if (input === null) {
194
+ return 'Null'
195
+ }
196
+ if (input === undefined) {
197
+ return 'Undefined'
198
+ }
199
+ if (Number.isNaN(input)) {
200
+ return 'NaN'
201
+ }
202
+ const typeResult = Object.prototype.toString.call(input).slice(8, -1);
203
+ return typeResult === 'AsyncFunction' ? 'Promise' : typeResult
204
+ }
205
+
206
+ function _lastIndexOf(valueToFind, list) {
207
+ if (!isArray(list)) {
208
+ throw new Error(`Cannot read property 'indexOf' of ${list}`)
209
+ }
210
+
211
+ const typeOfValue = type(valueToFind);
212
+ if (!['Array', 'NaN', 'Object', 'RegExp'].includes(typeOfValue)) {
213
+ return list.lastIndexOf(valueToFind)
214
+ }
215
+
216
+ const { length } = list;
217
+ let index = length;
218
+ let foundIndex = -1;
219
+
220
+ while (--index > -1 && foundIndex === -1) {
221
+ if (equalsFn(list[index], valueToFind)) {
222
+ foundIndex = index;
223
+ }
224
+ }
225
+
226
+ return foundIndex
227
+ }
228
+
229
+ function _indexOf(valueToFind, list) {
230
+ if (!isArray(list)) {
231
+ throw new Error(`Cannot read property 'indexOf' of ${list}`)
232
+ }
233
+
234
+ const typeOfValue = type(valueToFind);
235
+ if (!['Array', 'NaN', 'Object', 'RegExp'].includes(typeOfValue)) {
236
+ return list.indexOf(valueToFind)
237
+ }
238
+
239
+ let index = -1;
240
+ let foundIndex = -1;
241
+ const { length } = list;
242
+
243
+ while (++index < length && foundIndex === -1) {
244
+ if (equalsFn(list[index], valueToFind)) {
245
+ foundIndex = index;
246
+ }
247
+ }
248
+
249
+ return foundIndex
250
+ }
251
+
252
+ function _arrayFromIterator(iter) {
253
+ const list = [];
254
+ let next;
255
+ while (!(next = iter.next()).done) {
256
+ list.push(next.value);
257
+ }
258
+
259
+ return list
260
+ }
261
+
262
+ function _compareSets(a, b) {
263
+ if (a.size !== b.size) {
264
+ return false
265
+ }
266
+
267
+ const aList = _arrayFromIterator(a.values());
268
+ const bList = _arrayFromIterator(b.values());
269
+
270
+ const filtered = aList.filter(aInstance => _indexOf(aInstance, bList) === -1);
271
+
272
+ return filtered.length === 0
273
+ }
274
+
275
+ function compareErrors(a, b) {
276
+ if (a.message !== b.message) {
277
+ return false
278
+ }
279
+ if (a.toString !== b.toString) {
280
+ return false
281
+ }
282
+
283
+ return a.toString() === b.toString()
284
+ }
285
+
286
+ function parseDate(maybeDate) {
287
+ if (!maybeDate.toDateString) {
288
+ return [false]
289
+ }
290
+
291
+ return [true, maybeDate.getTime()]
292
+ }
293
+
294
+ function parseRegex(maybeRegex) {
295
+ if (maybeRegex.constructor !== RegExp) {
296
+ return [false]
297
+ }
298
+
299
+ return [true, maybeRegex.toString()]
300
+ }
301
+
302
+ function equalsFn(a, b) {
303
+ if (Object.is(a, b)) {
304
+ return true
305
+ }
306
+
307
+ const aType = type(a);
308
+
309
+ if (aType !== type(b)) {
310
+ return false
311
+ }
312
+ if (aType === 'Function') {
313
+ return a.name === undefined ? false : a.name === b.name
314
+ }
315
+
316
+ if (['NaN', 'Null', 'Undefined'].includes(aType)) {
317
+ return true
318
+ }
319
+
320
+ if (['BigInt', 'Number'].includes(aType)) {
321
+ if (Object.is(-0, a) !== Object.is(-0, b)) {
322
+ return false
323
+ }
324
+
325
+ return a.toString() === b.toString()
326
+ }
327
+
328
+ if (['Boolean', 'String'].includes(aType)) {
329
+ return a.toString() === b.toString()
330
+ }
331
+
332
+ if (aType === 'Array') {
333
+ const aClone = Array.from(a);
334
+ const bClone = Array.from(b);
335
+
336
+ if (aClone.toString() !== bClone.toString()) {
337
+ return false
338
+ }
339
+
340
+ let loopArrayFlag = true;
341
+ aClone.forEach((aCloneInstance, aCloneIndex) => {
342
+ if (loopArrayFlag) {
343
+ if (
344
+ aCloneInstance !== bClone[aCloneIndex] &&
345
+ !equalsFn(aCloneInstance, bClone[aCloneIndex])
346
+ ) {
347
+ loopArrayFlag = false;
348
+ }
349
+ }
350
+ });
351
+
352
+ return loopArrayFlag
353
+ }
354
+
355
+ const aRegex = parseRegex(a);
356
+ const bRegex = parseRegex(b);
357
+
358
+ if (aRegex[0]) {
359
+ return bRegex[0] ? aRegex[1] === bRegex[1] : false
360
+ }
361
+ if (bRegex[0]) {
362
+ return false
363
+ }
364
+
365
+ const aDate = parseDate(a);
366
+ const bDate = parseDate(b);
367
+
368
+ if (aDate[0]) {
369
+ return bDate[0] ? aDate[1] === bDate[1] : false
370
+ }
371
+ if (bDate[0]) {
372
+ return false
373
+ }
374
+
375
+ if (a instanceof Error) {
376
+ if (!(b instanceof Error)) {
377
+ return false
378
+ }
379
+
380
+ return compareErrors(a, b)
381
+ }
382
+
383
+ if (aType === 'Set') {
384
+ return _compareSets(a, b)
385
+ }
386
+
387
+ if (aType === 'Object') {
388
+ const aKeys = Object.keys(a);
389
+
390
+ if (aKeys.length !== Object.keys(b).length) {
391
+ return false
392
+ }
393
+
394
+ let loopObjectFlag = true;
395
+ aKeys.forEach(aKeyInstance => {
396
+ if (loopObjectFlag) {
397
+ const aValue = a[aKeyInstance];
398
+ const bValue = b[aKeyInstance];
399
+
400
+ if (aValue !== bValue && !equalsFn(aValue, bValue)) {
401
+ loopObjectFlag = false;
402
+ }
403
+ }
404
+ });
405
+
406
+ return loopObjectFlag
407
+ }
408
+
409
+ return false
410
+ }
411
+ function equals(a) {
412
+ return b => equalsFn(a, b)
413
+ }
414
+
415
+ function eqBy(fn, a) {
416
+ return b => equalsFn(fn(a), fn(b))
417
+ }
418
+
419
+ function prop(searchProperty) {
420
+ return obj => (obj ? obj[searchProperty] : undefined)
421
+ }
422
+
423
+ function eqProps(property, objA) {
424
+ return objB => equalsFn(prop(property)(objA), prop(property)(objB))
425
+ }
426
+
427
+ const { keys } = Object;
428
+
429
+ function mapObject(fn) {
430
+ return obj => {
431
+ let index = 0;
432
+ const objKeys = keys(obj);
433
+ const len = objKeys.length;
434
+ const willReturn = {};
435
+
436
+ while (index < len) {
437
+ const key = objKeys[index];
438
+ willReturn[key] = fn(obj[key], key, obj);
439
+ index++;
440
+ }
441
+
442
+ return willReturn
443
+ }
444
+ }
445
+
446
+ function evolveFn(rules, obj) {
447
+ return mapObject((x, prop) => {
448
+ if (type(x) === 'Object') {
449
+ const typeRule = type(rules[prop]);
450
+ if (typeRule === 'Function') {
451
+ return rules[prop](x)
452
+ }
453
+ if (typeRule === 'Object') {
454
+ return evolveFn(rules[prop], x)
455
+ }
456
+
457
+ return x
458
+ }
459
+ if (type(rules[prop]) === 'Function') {
460
+ return rules[prop](x)
461
+ }
462
+
463
+ return x
464
+ })(obj)
465
+ }
466
+
467
+ function evolve(rules) {
468
+ return obj => evolveFn(rules, obj)
469
+ }
470
+
471
+ function includes(valueToFind) {
472
+ return iterable =>
473
+ {
474
+ if (typeof iterable === 'string') {
475
+ return iterable.includes(valueToFind)
476
+ }
477
+ if (!iterable) {
478
+ throw new TypeError(`Cannot read property \'indexOf\' of ${iterable}`)
479
+ }
480
+ if (!isArray(iterable)) {
481
+ return false
482
+ }
483
+
484
+ return _indexOf(valueToFind, iterable) > -1
485
+ }
486
+ }
487
+
488
+ function excludes(valueToFind) {
489
+ return iterable => !includes(valueToFind)(iterable)
490
+ }
491
+
492
+ function filter(predicate) {
493
+ return list => {
494
+ if (!list) {
495
+ throw new Error('Incorrect iterable input')
496
+ }
497
+ let index = 0;
498
+ const len = list.length;
499
+ const willReturn = [];
500
+
501
+ while (index < len) {
502
+ if (predicate(list[index], index)) {
503
+ willReturn.push(list[index]);
504
+ }
505
+
506
+ index++;
507
+ }
508
+
509
+ return willReturn
510
+ }
511
+ }
512
+
513
+ function filterObject(predicate) {
514
+ return obj => {
515
+ const willReturn = {};
516
+
517
+ for (const prop in obj) {
518
+ if (predicate(obj[prop], prop, obj)) {
519
+ willReturn[prop] = obj[prop];
520
+ }
521
+ }
522
+
523
+ return willReturn
524
+ }
525
+ }
526
+
527
+ function find(predicate) {
528
+ return list => {
529
+ let index = 0;
530
+ const len = list.length;
531
+
532
+ while (index < len) {
533
+ const x = list[index];
534
+ if (predicate(x)) {
535
+ return x
536
+ }
537
+
538
+ index++;
539
+ }
540
+ }
541
+ }
542
+
543
+ function findIndex(predicate) {
544
+ return list => {
545
+ const len = list.length;
546
+ let index = -1;
547
+
548
+ while (++index < len) {
549
+ if (predicate(list[index])) {
550
+ return index
551
+ }
552
+ }
553
+
554
+ return -1
555
+ }
556
+ }
557
+
558
+ function findLast(predicate) {
559
+ return list => {
560
+ let index = list.length;
561
+
562
+ while (--index >= 0) {
563
+ if (predicate(list[index])) {
564
+ return list[index]
565
+ }
566
+ }
567
+
568
+ return undefined
569
+ }
570
+ }
571
+
572
+ function findLastIndex(fn) {
573
+ return list => {
574
+ let index = list.length;
575
+
576
+ while (--index >= 0) {
577
+ if (fn(list[index])) {
578
+ return index
579
+ }
580
+ }
581
+
582
+ return -1
583
+ }
584
+ }
585
+
586
+ function flatMap(fn) {
587
+ return list => [].concat(...list.map(fn))
588
+ }
589
+
590
+ function flatten(list, input) {
591
+ const willReturn = input === undefined ? [] : input;
592
+
593
+ for (let i = 0; i < list.length; i++) {
594
+ if (isArray(list[i])) {
595
+ flatten(list[i], willReturn);
596
+ } else {
597
+ willReturn.push(list[i]);
598
+ }
599
+ }
600
+
601
+ return willReturn
602
+ }
603
+
604
+ function groupBy(groupFn, list) {
605
+ if (arguments.length === 1) {
606
+ return _list => groupBy(groupFn, _list)
607
+ }
608
+
609
+ const result = {};
610
+ for (let i = 0; i < list.length; i++) {
611
+ const item = list[i];
612
+ const key = groupFn(item);
613
+
614
+ if (!result[key]) {
615
+ result[key] = [];
616
+ }
617
+
618
+ result[key].push(item);
619
+ }
620
+
621
+ return result
622
+ }
623
+
624
+ function head(listOrString) {
625
+ if (typeof listOrString === 'string') {
626
+ return listOrString[0] || ''
627
+ }
628
+
629
+ return listOrString[0]
630
+ }
631
+
632
+ function indexOf(valueToFind) {
633
+ return list => _indexOf(valueToFind, list)
634
+ }
635
+
636
+ function baseSlice(array, start, end) {
637
+ let index = -1;
638
+ let { length } = array;
639
+
640
+ end = end > length ? length : end;
641
+ if (end < 0) {
642
+ end += length;
643
+ }
644
+ length = start > end ? 0 : (end - start) >>> 0;
645
+ start >>>= 0;
646
+
647
+ const result = Array(length);
648
+
649
+ while (++index < length) {
650
+ result[index] = array[index + start];
651
+ }
652
+
653
+ return result
654
+ }
655
+
656
+ function init(input) {
657
+ if (typeof input === 'string') {
658
+ return input.slice(0, -1)
659
+ }
660
+
661
+ return input.length ? baseSlice(input, 0, -1) : []
662
+ }
663
+
664
+ function _includesWith(pred, x, list) {
665
+ let idx = 0;
666
+ const len = list.length;
667
+
668
+ while (idx < len) {
669
+ if (pred(x, list[idx])) {
670
+ return true
671
+ }
672
+
673
+ idx += 1;
674
+ }
675
+
676
+ return false
677
+ }
678
+ function _filter(fn, list) {
679
+ let idx = 0;
680
+ const len = list.length;
681
+ const result = [];
682
+
683
+ while (idx < len) {
684
+ if (fn(list[idx])) {
685
+ result[result.length] = list[idx];
686
+ }
687
+
688
+ idx += 1;
689
+ }
690
+
691
+ return result
692
+ }
693
+
694
+ function innerJoin(pred, xs) {
695
+ return ys => _filter(x => _includesWith(pred, x, ys), xs)
696
+ }
697
+
698
+ function intersection(listA) {
699
+ return listB =>filter(x => includes(x)(listA))(listB)
700
+ }
701
+
702
+ function intersperse(separator) {
703
+ return list => {
704
+ let index = -1;
705
+ const len = list.length;
706
+ const willReturn = [];
707
+
708
+ while (++index < len) {
709
+ if (index === len - 1) {
710
+ willReturn.push(list[index]);
711
+ } else {
712
+ willReturn.push(list[index], separator);
713
+ }
714
+ }
715
+
716
+ return willReturn
717
+ }
718
+ }
719
+
720
+ function join(glue) {
721
+ return list=> list.join(glue)
722
+ }
723
+
724
+ function last(listOrString) {
725
+ if (typeof listOrString === 'string') {
726
+ return listOrString[listOrString.length - 1] || ''
727
+ }
728
+
729
+ return listOrString[listOrString.length - 1]
730
+ }
731
+
732
+ function lastIndexOf(valueToFind) {
733
+ return list => _lastIndexOf(valueToFind, list)
734
+ }
735
+
736
+ function map(fn) {
737
+ return list => {
738
+ let index = 0;
739
+ const willReturn = Array(list.length);
740
+ while (index < list.length) {
741
+ willReturn[index] = fn(list[index], index);
742
+ index++;
743
+ }
744
+ return willReturn
745
+ }
746
+ }
747
+
748
+ function mapAsync(fn) {
749
+ return async list => {
750
+ const willReturn = [];
751
+ let i = 0;
752
+ for (const a of list) {
753
+ willReturn.push(await fn(a, i++));
754
+ }
755
+
756
+ return willReturn
757
+ }
758
+ }
759
+
760
+ function mapObjectAsync(fn) {
761
+ return async obj => {
762
+ const willReturn = {};
763
+ for (const prop in obj){
764
+ willReturn[ prop ] = await fn(obj[ prop ], prop);
765
+ }
766
+
767
+ return willReturn
768
+ }
769
+ }
770
+
771
+ function match(pattern) {
772
+ return input => {
773
+ const willReturn = input.match(pattern);
774
+
775
+ return willReturn === null ? [] : willReturn
776
+ }
777
+ }
778
+
779
+ function maxBy(compareFn, x) {
780
+ return y => (compareFn(y) > compareFn(x) ? y : x)
781
+ }
782
+
783
+ function merge(target) {
784
+ return objectWithNewProps =>
785
+ Object.assign({}, target || {}, objectWithNewProps || {})
786
+ }
787
+
788
+ function mergeTypes(x) {
789
+ return x
790
+ }
791
+
792
+ function minBy(compareFn, x) {
793
+ return y => (compareFn(y) < compareFn(x) ? y : x)
794
+ }
795
+
796
+ function createPath(path, delimiter = '.') {
797
+ return typeof path === 'string'
798
+ ? path.split(delimiter).map(x => (Number.isInteger(Number(x)) ? Number(x) : x))
799
+ : path
800
+ }
801
+
802
+ function path(pathInput, obj) {
803
+ if (arguments.length === 1) {
804
+ return _obj => path(pathInput, _obj)
805
+ }
806
+
807
+ if (!obj) {
808
+ return undefined
809
+ }
810
+ let willReturn = obj;
811
+ let counter = 0;
812
+
813
+ const pathArrValue = createPath(pathInput);
814
+
815
+ while (counter < pathArrValue.length) {
816
+ if (willReturn === null || willReturn === undefined) {
817
+ return undefined
818
+ }
819
+ if (willReturn[pathArrValue[counter]] === null) {
820
+ return undefined
821
+ }
822
+
823
+ willReturn = willReturn[pathArrValue[counter]];
824
+ counter++;
825
+ }
826
+
827
+ return willReturn
828
+ }
829
+
830
+ function assoc(prop, newValue) {
831
+ return obj => Object.assign({}, obj, { [prop]: newValue })
832
+ }
833
+
834
+ function modifyPathFn(pathInput, fn, obj) {
835
+ const path$1 = createPath(pathInput);
836
+ if (path$1.length === 1) {
837
+ return {
838
+ ...obj,
839
+ [path$1[0]]: fn(obj[path$1[0]]),
840
+ }
841
+ }
842
+ if (path(path$1)(obj) === undefined) {
843
+ return obj
844
+ }
845
+
846
+ const val = modifyPathFn(Array.prototype.slice.call(path$1, 1), fn, obj[path$1[0]]);
847
+ if (val === obj[path$1[0]]) {
848
+ return obj
849
+ }
850
+
851
+ return assoc(path$1[0], val)(obj)
852
+ }
853
+
854
+ function modifyPath(pathInput, fn) {
855
+ return obj => modifyPathFn(pathInput, fn, obj)
856
+ }
857
+
858
+ function none(predicate) {
859
+ return list => {
860
+ for (let i = 0; i < list.length; i++) {
861
+ if (predicate(list[i])) {
862
+ return false
863
+ }
864
+ }
865
+
866
+ return true
867
+ }
868
+ }
869
+
870
+ function objOf(key) {
871
+ return value => ({ [key]: value })
872
+ }
873
+
874
+ function _includes(x, list) {
875
+ let index = -1;
876
+ const { length } = list;
877
+
878
+ while (++index < length) {
879
+ if (String(list[index]) === String(x)) {
880
+ return true
881
+ }
882
+ }
883
+
884
+ return false
885
+ }
886
+
887
+ function omit(propsToOmit) {
888
+ return obj => {
889
+ if (!obj) {
890
+ return undefined
891
+ }
892
+
893
+ const propsToOmitValue = createPath(propsToOmit, ',');
894
+ const willReturn = {};
895
+
896
+ for (const key in obj) {
897
+ if (!_includes(key, propsToOmitValue)) {
898
+ willReturn[key] = obj[key];
899
+ }
900
+ }
901
+
902
+ return willReturn
903
+ }
904
+ }
905
+
906
+ function partitionObject(predicate, iterable) {
907
+ const yes = {};
908
+ const no = {};
909
+ Object.entries(iterable).forEach(([prop, value]) => {
910
+ if (predicate(value, prop)) {
911
+ yes[prop] = value;
912
+ } else {
913
+ no[prop] = value;
914
+ }
915
+ });
916
+
917
+ return [yes, no]
918
+ }
919
+
920
+ function partitionArray(predicate, list, indexed = false) {
921
+ const yes = [];
922
+ const no = [];
923
+ let counter = -1;
924
+
925
+ while (counter++ < list.length - 1) {
926
+ if (indexed ? predicate(list[counter], counter) : predicate(list[counter])) {
927
+ yes.push(list[counter]);
928
+ } else {
929
+ no.push(list[counter]);
930
+ }
931
+ }
932
+
933
+ return [yes, no]
934
+ }
935
+
936
+ function partition(predicate) {
937
+ return iterable => {
938
+ if (!isArray(iterable)) {
939
+ return partitionObject(predicate, iterable)
940
+ }
941
+
942
+ return partitionArray(predicate, iterable)
943
+ }
944
+ }
945
+
946
+ function pick(propsToPick) {
947
+ return input => {
948
+ if (!input === null) {
949
+ return undefined
950
+ }
951
+ const keys = createPath(propsToPick, ',');
952
+ const willReturn = {};
953
+ let counter = 0;
954
+
955
+ while (counter < keys.length) {
956
+ if (keys[counter] in input) {
957
+ willReturn[keys[counter]] = input[keys[counter]];
958
+ }
959
+ counter++;
960
+ }
961
+
962
+ return willReturn
963
+ }
964
+ }
965
+
966
+ function reduce(reducer, acc) {
967
+ return list => {
968
+ if (list == null) {
969
+ return acc
970
+ }
971
+ if (!isArray(list)) {
972
+ throw new TypeError('reduce: list must be array or iterable')
973
+ }
974
+ let index = 0;
975
+ const len = list.length;
976
+
977
+ while (index < len) {
978
+ acc = reducer(acc, list[index], index, list);
979
+ index++;
980
+ }
981
+
982
+ return acc
983
+ }
984
+ }
985
+
986
+ function _arity(n, fn) {
987
+ switch (n) {
988
+ case 0:
989
+ return function () {
990
+ return fn.apply(this, arguments)
991
+ }
992
+ case 1:
993
+ return function (a0) {
994
+ return fn.apply(this, arguments)
995
+ }
996
+ case 2:
997
+ return function (a0, a1) {
998
+ return fn.apply(this, arguments)
999
+ }
1000
+ case 3:
1001
+ return function (a0, a1, a2) {
1002
+ return fn.apply(this, arguments)
1003
+ }
1004
+ case 4:
1005
+ return function (a0, a1, a2, a3) {
1006
+ return fn.apply(this, arguments)
1007
+ }
1008
+ case 5:
1009
+ return function (a0, a1, a2, a3, a4) {
1010
+ return fn.apply(this, arguments)
1011
+ }
1012
+ case 6:
1013
+ return function (a0, a1, a2, a3, a4, a5) {
1014
+ return fn.apply(this, arguments)
1015
+ }
1016
+ case 7:
1017
+ return function (a0, a1, a2, a3, a4, a5, a6) {
1018
+ return fn.apply(this, arguments)
1019
+ }
1020
+ case 8:
1021
+ return function (a0, a1, a2, a3, a4, a5, a6, a7) {
1022
+ return fn.apply(this, arguments)
1023
+ }
1024
+ case 9:
1025
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
1026
+ return fn.apply(this, arguments)
1027
+ }
1028
+ case 10:
1029
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
1030
+ return fn.apply(this, arguments)
1031
+ }
1032
+ default:
1033
+ throw new Error(
1034
+ 'First argument to _arity must be a non-negative integer no greater than ten',
1035
+ )
1036
+ }
1037
+ }
1038
+
1039
+ function _pipe(f, g) {
1040
+ return function () {
1041
+ return g.call(this, f.apply(this, arguments))
1042
+ }
1043
+ }
1044
+
1045
+ function pipeFn() {
1046
+ if (arguments.length === 0) {
1047
+ throw new Error('pipe requires at least one argument')
1048
+ }
1049
+
1050
+ return _arity(
1051
+ arguments[0].length,
1052
+ reduce(
1053
+ _pipe,
1054
+ arguments[0],
1055
+ )(Array.prototype.slice.call(arguments, 1, Number.POSITIVE_INFINITY)),
1056
+ )
1057
+ }
1058
+
1059
+ function pipe(...inputs) {
1060
+ const [input, ...fnList] = inputs;
1061
+
1062
+ return pipeFn(...fnList)(input)
1063
+ }
1064
+
1065
+ async function pipeAsync(input, ...fnList) {
1066
+ let willReturn = input;
1067
+ for (const fn of fnList) {
1068
+ const initialResult = fn(willReturn);
1069
+ willReturn = type(initialResult) === 'Promise' ? await initialResult : initialResult;
1070
+ }
1071
+ return willReturn
1072
+ }
1073
+
1074
+ function pluck(property) {
1075
+ return list => {
1076
+ const willReturn = [];
1077
+
1078
+ list.forEach(x => {
1079
+ if (x[property] !== undefined) {
1080
+ willReturn.push(x[property]);
1081
+ }
1082
+ });
1083
+
1084
+ return willReturn
1085
+ }
1086
+ }
1087
+
1088
+ function prepend(x) {
1089
+ return list=> [x].concat(list)
1090
+ }
1091
+
1092
+ function propEq(valueToMatch, propToFind) {
1093
+ return obj => {
1094
+ if (!obj) {
1095
+ return false
1096
+ }
1097
+
1098
+ return equalsFn(valueToMatch, obj[propToFind])
1099
+ }
1100
+ }
1101
+
1102
+ function propOr(defaultValue, property) {
1103
+ return obj => {
1104
+ if (!obj) {
1105
+ return defaultValue
1106
+ }
1107
+
1108
+ return defaultTo(defaultValue, obj[property])
1109
+ }
1110
+ }
1111
+
1112
+ function propSatisfies(predicate, property) {
1113
+ return obj => predicate(prop(property))
1114
+ }
1115
+
1116
+ function range(start){
1117
+ return end => {
1118
+ if (Number.isNaN(Number(start)) || Number.isNaN(Number(end))){
1119
+ throw new TypeError('Both arguments to range must be numbers')
1120
+ }
1121
+
1122
+ if (end < start) return []
1123
+
1124
+ const len = end - start;
1125
+ const willReturn = Array(len);
1126
+
1127
+ for (let i = 0; i < len; i++){
1128
+ willReturn[ i ] = start + i;
1129
+ }
1130
+
1131
+ return willReturn
1132
+ }
1133
+ }
1134
+
1135
+ function reject(predicate) {
1136
+ return list => filter(x => !predicate(x))
1137
+ }
1138
+
1139
+ function replace(pattern, replacer) {
1140
+ return str => str.replace(pattern, replacer)
1141
+ }
1142
+
1143
+ function replaceItemAtIndex(index, replaceFn) {
1144
+ return list => {
1145
+ const actualIndex = index < 0 ? list.length + index : index;
1146
+ if (index >= list.length || actualIndex < 0) {
1147
+ return list
1148
+ }
1149
+
1150
+ const clone = cloneList(list);
1151
+ clone[actualIndex] = replaceFn(clone[actualIndex]);
1152
+
1153
+ return clone
1154
+ }
1155
+ }
1156
+
1157
+ function sort(sortFn){
1158
+ return list => cloneList(list).sort(sortFn)
1159
+ }
1160
+
1161
+ function sortBy(sortFn){
1162
+ return list => {
1163
+ const clone = cloneList(list);
1164
+
1165
+ return clone.sort((a, b) => {
1166
+ const aSortResult = sortFn(a);
1167
+ const bSortResult = sortFn(b);
1168
+
1169
+ if (aSortResult === bSortResult) return 0
1170
+
1171
+ return aSortResult < bSortResult ? -1 : 1
1172
+ })
1173
+ }
1174
+ }
1175
+
1176
+ function sortHelper(a, b, listOfSortingFns) {
1177
+ let result = 0;
1178
+ let i = 0;
1179
+ while (result === 0 && i < listOfSortingFns.length) {
1180
+ result = listOfSortingFns[i](a, b);
1181
+ i += 1;
1182
+ }
1183
+
1184
+ return result
1185
+ }
1186
+
1187
+ function sortWith(listOfSortingFns) {
1188
+ return list => {
1189
+ if (Array.isArray(list) === false) {
1190
+ return []
1191
+ }
1192
+
1193
+ const clone = list.slice();
1194
+ clone.sort((a, b) => sortHelper(a, b, listOfSortingFns));
1195
+
1196
+ return clone
1197
+ }
1198
+ }
1199
+
1200
+ function split(separator){
1201
+ return str => str.split(separator)
1202
+ }
1203
+
1204
+ function splitEvery(sliceLength) {
1205
+ return list => {
1206
+ if (sliceLength < 1) {
1207
+ throw new Error('First argument to splitEvery must be a positive integer')
1208
+ }
1209
+
1210
+ const willReturn = [];
1211
+ let counter = 0;
1212
+
1213
+ while (counter < list.length) {
1214
+ willReturn.push(list.slice(counter, (counter += sliceLength)));
1215
+ }
1216
+
1217
+ return willReturn
1218
+ }
1219
+ }
1220
+
1221
+ function symmetricDifference(x) {
1222
+ return y => [
1223
+ ...filter(value => !includes(value)(y))(x),
1224
+ ...filter(value => !includes(value)(x))(y),
1225
+ ]
1226
+ }
1227
+
1228
+ function tail(listOrString) {
1229
+ return drop(1)(listOrString)
1230
+ }
1231
+
1232
+ function take(numberOfItems) {
1233
+ return input => {
1234
+ if (numberOfItems < 0) {
1235
+ return input.slice()
1236
+ }
1237
+ if (typeof input === 'string') {
1238
+ return input.slice(0, numberOfItems)
1239
+ }
1240
+
1241
+ return baseSlice(input, 0, numberOfItems)
1242
+ }
1243
+ }
1244
+
1245
+ function takeLast(numberOfItems) {
1246
+ return input => {
1247
+ const len = input.length;
1248
+ if (numberOfItems < 0) {
1249
+ return input.slice()
1250
+ }
1251
+ let numValue = numberOfItems > len ? len : numberOfItems;
1252
+
1253
+ if (typeof input === 'string') {
1254
+ return input.slice(len - numValue)
1255
+ }
1256
+
1257
+ numValue = len - numValue;
1258
+
1259
+ return baseSlice(input, numValue, len)
1260
+ }
1261
+ }
1262
+
1263
+ function takeLastWhile(predicate) {
1264
+ return input => {
1265
+ if (input.length === 0) {
1266
+ return input
1267
+ }
1268
+
1269
+ const toReturn = [];
1270
+ let counter = input.length;
1271
+
1272
+ while (counter) {
1273
+ const item = input[--counter];
1274
+ if (!predicate(item)) {
1275
+ break
1276
+ }
1277
+ toReturn.push(item);
1278
+ }
1279
+
1280
+ return toReturn.reverse()
1281
+ }
1282
+ }
1283
+
1284
+ function takeWhile(predicate) {
1285
+ return iterable => {
1286
+ const toReturn = [];
1287
+ let counter = 0;
1288
+
1289
+ while (counter < iterable.length) {
1290
+ const item = iterable[counter++];
1291
+ if (!predicate(item)) {
1292
+ break
1293
+ }
1294
+ toReturn.push(item);
1295
+ }
1296
+ return toReturn
1297
+ }
1298
+ }
1299
+
1300
+ function tap(fn) {
1301
+ return x => {
1302
+ fn(x);
1303
+
1304
+ return x
1305
+ }
1306
+ }
1307
+
1308
+ function test(pattern) {
1309
+ return str => str.search(pattern) !== -1
1310
+ }
1311
+
1312
+ function tryCatch(fn, fallback) {
1313
+ return input => {
1314
+ try {
1315
+ return fn(input)
1316
+ } catch (e) {
1317
+ return fallback
1318
+ }
1319
+ }
1320
+ }
1321
+
1322
+ function union(x) {
1323
+ return y => {
1324
+ const toReturn = cloneList(x);
1325
+
1326
+ y.forEach(yInstance => {
1327
+ if (!includes(yInstance)(x)) {
1328
+ toReturn.push(yInstance);
1329
+ }
1330
+ });
1331
+
1332
+ return toReturn
1333
+ }
1334
+ }
1335
+
1336
+ class _Set {
1337
+ constructor() {
1338
+ this.set = new Set();
1339
+ this.items = {};
1340
+ }
1341
+
1342
+ checkUniqueness(item) {
1343
+ const type$1 = type(item);
1344
+ if (['Null', 'Undefined', 'NaN'].includes(type$1)) {
1345
+ if (type$1 in this.items) {
1346
+ return false
1347
+ }
1348
+ this.items[type$1] = true;
1349
+
1350
+ return true
1351
+ }
1352
+ if (!['Object', 'Array'].includes(type$1)) {
1353
+ const prevSize = this.set.size;
1354
+ this.set.add(item);
1355
+
1356
+ return this.set.size !== prevSize
1357
+ }
1358
+
1359
+ if (!(type$1 in this.items)) {
1360
+ this.items[type$1] = [item];
1361
+
1362
+ return true
1363
+ }
1364
+
1365
+ if (_indexOf(item, this.items[type$1]) === -1) {
1366
+ this.items[type$1].push(item);
1367
+
1368
+ return true
1369
+ }
1370
+
1371
+ return false
1372
+ }
1373
+ }
1374
+
1375
+ function uniq(list) {
1376
+ const set = new _Set();
1377
+ const willReturn = [];
1378
+ list.forEach(item => {
1379
+ if (set.checkUniqueness(item)) {
1380
+ willReturn.push(item);
1381
+ }
1382
+ });
1383
+
1384
+ return willReturn
1385
+ }
1386
+
1387
+ function uniqBy(fn) {
1388
+ return list => {
1389
+ const set = new _Set();
1390
+
1391
+ return list.filter(item => set.checkUniqueness(fn(item)))
1392
+ }
1393
+ }
1394
+
1395
+ function includesWith(predicate, target, list) {
1396
+ let willReturn = false;
1397
+ let index = -1;
1398
+
1399
+ while (++index < list.length && !willReturn) {
1400
+ const value = list[index];
1401
+
1402
+ if (predicate(target, value)) {
1403
+ willReturn = true;
1404
+ }
1405
+ }
1406
+
1407
+ return willReturn
1408
+ }
1409
+
1410
+ function uniqWith(predicate) {
1411
+ return list => {
1412
+ let index = -1;
1413
+ const willReturn = [];
1414
+
1415
+ while (++index < list.length) {
1416
+ const value = list[index];
1417
+
1418
+ if (!includesWith(predicate, value, willReturn)) {
1419
+ willReturn.push(value);
1420
+ }
1421
+ }
1422
+
1423
+ return willReturn
1424
+ }
1425
+ }
1426
+
1427
+ function unless(predicate, whenFalseFn) {
1428
+ return input => {
1429
+ if (predicate(input)) {
1430
+ return input
1431
+ }
1432
+
1433
+ return whenFalseFn(input)
1434
+ }
1435
+ }
1436
+
1437
+ function unwind(property) {
1438
+ return obj => {
1439
+ return obj[property].map(x => ({
1440
+ ...obj,
1441
+ [property]: x,
1442
+ }))
1443
+ }
1444
+ }
1445
+
1446
+ function update(index, newValue) {
1447
+ return list => {
1448
+ const clone = cloneList(list);
1449
+ if (index === -1) {
1450
+ return clone.fill(newValue, index)
1451
+ }
1452
+
1453
+ return clone.fill(newValue, index, index + 1)
1454
+ }
1455
+ }
1456
+
1457
+ function when(predicate, whenTrueFn) {
1458
+ return input => {
1459
+ if (!predicate(input)) {
1460
+ return input
1461
+ }
1462
+
1463
+ return whenTrueFn(input)
1464
+ }
1465
+ }
1466
+
1467
+ function zip(left) {
1468
+ return right => {
1469
+ const result = [];
1470
+ const length = Math.min(left.length, right.length);
1471
+
1472
+ for (let i = 0; i < length; i++) {
1473
+ result[i] = [left[i], right[i]];
1474
+ }
1475
+
1476
+ return result
1477
+ }
1478
+ }
1479
+
1480
+ function zipWith(fn, x) {
1481
+ return y =>
1482
+ take(x.length > y.length ? y.length : x.length)(x).map((xInstance, i) =>
1483
+ fn(xInstance, y[i]),
1484
+ )
1485
+ }
1486
+
1487
+ export { _arity, _includes, _indexOf, _lastIndexOf, all, allPass, any, anyPass, append, checkObjectWithSpec, complement, concat, count, countBy, defaultTo, drop, dropLast, dropLastWhile, dropWhile, eqBy, eqProps, equals, equalsFn, evolve, evolveFn, excludes, filter, filterObject, find, findIndex, findLast, findLastIndex, flatMap, flatten, groupBy, head, includes, indexOf, init, innerJoin, intersection, intersperse, join, last, lastIndexOf, map, mapAsync, mapObject, mapObjectAsync, match, maxBy, merge, mergeTypes, minBy, modifyPath, none, objOf, omit, partition, partitionArray, partitionObject, path, pick, pipe, pipeAsync, pluck, prepend, prop, propEq, propOr, propSatisfies, range, reduce, reject, replace, replaceItemAtIndex, sort, sortBy, sortWith, split, splitEvery, symmetricDifference, tail, take, takeLast, takeLastWhile, takeWhile, tap, test, tryCatch, type, union, uniq, uniqBy, uniqWith, unless, unwind, update, when, zip, zipWith };