@baleada/logic 0.20.33 → 0.21.1

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.
package/lib/index.cjs CHANGED
@@ -50,34 +50,30 @@ function createFilterAsync(condition) {
50
50
  return createFilter((_, index) => transformedAsync[index])(array);
51
51
  };
52
52
  }
53
- function createDelete(required) {
53
+ function createDelete(index) {
54
54
  return (array) => {
55
- const deleteIndex = "index" in required ? required.index : lazyCollections.findIndex((element) => element === required?.item)(array);
56
- return createConcat(createSlice({ from: 0, to: deleteIndex })(array), createSlice({ from: deleteIndex + 1 })(array))([]);
55
+ return createConcat(createSlice(0, index)(array), createSlice(index + 1)(array))([]);
57
56
  };
58
57
  }
59
- function createInsert(required) {
58
+ function createInsert(item, index) {
60
59
  return (array) => {
61
- const itemsToInsert = "items" in required ? required.items : [required.item], withItems = createConcat(array, itemsToInsert)([]);
62
- return createReorder({
63
- from: { start: array.length, itemCount: itemsToInsert.length },
64
- to: required.index
65
- })(withItems);
60
+ const withItems = createConcat(array, [item])([]);
61
+ return createReorder({ start: array.length, itemCount: 1 }, index)(withItems);
66
62
  };
67
63
  }
68
- function createReorder({ from, to }) {
64
+ function createReorder(from, to) {
69
65
  return (array) => {
70
66
  const [itemsToMoveStartIndex, itemsToMoveCount] = isObject(from) ? [from.start, from.itemCount] : [from, 1], insertIndex = to;
71
67
  if (insertIndex > itemsToMoveStartIndex && insertIndex < itemsToMoveStartIndex + itemsToMoveCount) {
72
68
  return array;
73
69
  }
74
- const itemsToMove = createSlice({ from: itemsToMoveStartIndex, to: itemsToMoveStartIndex + itemsToMoveCount })(array);
70
+ const itemsToMove = createSlice(itemsToMoveStartIndex, itemsToMoveStartIndex + itemsToMoveCount)(array);
75
71
  if (itemsToMoveStartIndex < insertIndex) {
76
- const beforeItemsToMove = itemsToMoveStartIndex === 0 ? [] : createSlice({ from: 0, to: itemsToMoveStartIndex })(array), betweenItemsToMoveAndInsertIndex = createSlice({ from: itemsToMoveStartIndex + itemsToMoveCount, to: insertIndex + 1 })(array), afterInsertIndex = createSlice({ from: insertIndex + 1 })(array);
72
+ const beforeItemsToMove = itemsToMoveStartIndex === 0 ? [] : createSlice(0, itemsToMoveStartIndex)(array), betweenItemsToMoveAndInsertIndex = createSlice(itemsToMoveStartIndex + itemsToMoveCount, insertIndex + 1)(array), afterInsertIndex = createSlice(insertIndex + 1)(array);
77
73
  return createConcat(beforeItemsToMove, betweenItemsToMoveAndInsertIndex, itemsToMove, afterInsertIndex)([]);
78
74
  }
79
75
  if (itemsToMoveStartIndex > insertIndex) {
80
- const beforeInsertion = insertIndex === 0 ? [] : createSlice({ from: 0, to: insertIndex })(array), betweenInsertionAndItemsToMove = createSlice({ from: insertIndex, to: itemsToMoveStartIndex })(array), afterItemsToMove = createSlice({ from: itemsToMoveStartIndex + itemsToMoveCount })(array);
76
+ const beforeInsertion = insertIndex === 0 ? [] : createSlice(0, insertIndex)(array), betweenInsertionAndItemsToMove = createSlice(insertIndex, itemsToMoveStartIndex)(array), afterItemsToMove = createSlice(itemsToMoveStartIndex + itemsToMoveCount)(array);
81
77
  return createConcat(beforeInsertion, itemsToMove, betweenInsertionAndItemsToMove, afterItemsToMove)([]);
82
78
  }
83
79
  return array;
@@ -86,19 +82,19 @@ function createReorder({ from, to }) {
86
82
  function isObject(value) {
87
83
  return typeof value === "object";
88
84
  }
89
- function createSwap({ indices }) {
85
+ function createSwap(indices) {
90
86
  return (array) => {
91
87
  const { 0: from, 1: to } = indices, { reorderFrom, reorderTo } = (() => {
92
88
  if (from < to) {
93
89
  return {
94
- reorderFrom: createReorder({ from, to }),
95
- reorderTo: createReorder({ from: to - 1, to: from })
90
+ reorderFrom: createReorder(from, to),
91
+ reorderTo: createReorder(to - 1, from)
96
92
  };
97
93
  }
98
94
  if (from > to) {
99
95
  return {
100
- reorderFrom: createReorder({ from, to }),
101
- reorderTo: createReorder({ from: to + 1, to: from })
96
+ reorderFrom: createReorder(from, to),
97
+ reorderTo: createReorder(to + 1, from)
102
98
  };
103
99
  }
104
100
  return {
@@ -109,15 +105,15 @@ function createSwap({ indices }) {
109
105
  return new Pipeable(array).pipe(reorderFrom, reorderTo);
110
106
  };
111
107
  }
112
- function createReplace({ index, item }) {
108
+ function createReplace(index, item) {
113
109
  return (array) => {
114
- return createConcat(createSlice({ from: 0, to: index })(array), [item], createSlice({ from: index + 1 })(array))([]);
110
+ return createConcat(createSlice(0, index)(array), [item], createSlice(index + 1)(array))([]);
115
111
  };
116
112
  }
117
113
  function createUnique() {
118
114
  return (array) => lazyCollections.pipe(lazyCollections.unique(), lazyCollections.toArray())(array);
119
115
  }
120
- function createSlice({ from, to }) {
116
+ function createSlice(from, to) {
121
117
  return (array) => {
122
118
  return from === to ? [] : lazyCollections.pipe(lazyCollections.slice(from, to - 1), lazyCollections.toArray())(array);
123
119
  };
@@ -140,6 +136,11 @@ function createReverse() {
140
136
  return reversed;
141
137
  };
142
138
  }
139
+ function createSort(compare) {
140
+ return (array) => {
141
+ return new Pipeable(array).pipe(createSlice(0), (sliced) => sliced.sort(compare));
142
+ };
143
+ }
143
144
  function createSlug(options) {
144
145
  return (string) => {
145
146
  return slugify__default["default"](string, options);
@@ -150,7 +151,7 @@ function createClip(required) {
150
151
  return string.replace(required, "");
151
152
  };
152
153
  }
153
- function createClamp({ min, max }) {
154
+ function createClamp(min, max) {
154
155
  return (number) => {
155
156
  const maxed = Math.max(number, min);
156
157
  return Math.min(maxed, max);
@@ -166,9 +167,9 @@ function createDetermine(potentialities) {
166
167
  })(potentialities);
167
168
  return (determinant) => lazyCollections.find(({ predicate }) => predicate(determinant))(predicates).outcome;
168
169
  }
169
- function createRename({ from, to }) {
170
+ function createRename(from, to) {
170
171
  return (map2) => {
171
- const keys = [...map2.keys()], keyToRenameIndex = lazyCollections.findIndex((k) => k === from)(keys), newKeys = createReplace({ index: keyToRenameIndex, item: to })(keys), values = [...map2.values()];
172
+ const keys = [...map2.keys()], keyToRenameIndex = lazyCollections.findIndex((k) => k === from)(keys), newKeys = createReplace(keyToRenameIndex, to)(keys), values = [...map2.values()];
172
173
  return createReduce((renamed, key, index) => renamed.set(key, values[index]), /* @__PURE__ */ new Map())(newKeys);
173
174
  };
174
175
  }
@@ -193,239 +194,6 @@ class Pipeable {
193
194
  }
194
195
  }
195
196
 
196
- function toEvent(eventType, options) {
197
- const implementation = toImplementation(eventType);
198
- switch (implementation) {
199
- case "keycombo": {
200
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
201
- return new KeyboardEvent("keyDirection" in options ? `key${options.keyDirection}` : "keydown", {
202
- ...options.init || {},
203
- key: toKey(name),
204
- ...createReduce((flags, alias) => {
205
- flags[toModifierFlag(alias)] = true;
206
- return flags;
207
- }, {})(modifiers)
208
- });
209
- }
210
- case "leftclickcombo":
211
- case "rightclickcombo": {
212
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
213
- return new MouseEvent(name === "rightclick" ? "contextmenu" : name, {
214
- ...options.init || {},
215
- ...createReduce((flags, alias) => {
216
- flags[toModifierFlag(alias)] = true;
217
- return flags;
218
- }, {})(modifiers)
219
- });
220
- }
221
- case "pointercombo": {
222
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
223
- return new PointerEvent(name === "rightclick" ? "contextmenu" : name, {
224
- ...options.init || {},
225
- ...createReduce((flags, alias) => {
226
- flags[toModifierFlag(alias)] = true;
227
- return flags;
228
- }, {})(modifiers)
229
- });
230
- }
231
- case "documentevent":
232
- case "event":
233
- if (eventType === "abort")
234
- return new UIEvent(eventType, options.init);
235
- if (eventType === "animationcancel")
236
- return new AnimationEvent(eventType, options.init);
237
- if (eventType === "animationend")
238
- return new AnimationEvent(eventType, options.init);
239
- if (eventType === "animationiteration")
240
- return new AnimationEvent(eventType, options.init);
241
- if (eventType === "animationstart")
242
- return new AnimationEvent(eventType, options.init);
243
- if (eventType === "auxclick")
244
- return new MouseEvent(eventType, options.init);
245
- if (eventType === "beforeinput")
246
- return new InputEvent(eventType, options.init);
247
- if (eventType === "blur")
248
- return new FocusEvent(eventType, options.init);
249
- if (eventType === "canplay")
250
- return new Event(eventType, options.init);
251
- if (eventType === "canplaythrough")
252
- return new Event(eventType, options.init);
253
- if (eventType === "change")
254
- return new Event(eventType, options.init);
255
- if (eventType === "click")
256
- return new MouseEvent(eventType, options.init);
257
- if (eventType === "close")
258
- return new Event(eventType, options.init);
259
- if (eventType === "compositionend")
260
- return new CompositionEvent(eventType, options.init);
261
- if (eventType === "compositionstart")
262
- return new CompositionEvent(eventType, options.init);
263
- if (eventType === "compositionupdate")
264
- return new CompositionEvent(eventType, options.init);
265
- if (eventType === "contextmenu")
266
- return new MouseEvent(eventType, options.init);
267
- if (eventType === "cuechange")
268
- return new Event(eventType, options.init);
269
- if (eventType === "dblclick")
270
- return new MouseEvent(eventType, options.init);
271
- if (eventType === "drag")
272
- return new DragEvent(eventType, options.init);
273
- if (eventType === "dragend")
274
- return new DragEvent(eventType, options.init);
275
- if (eventType === "dragenter")
276
- return new DragEvent(eventType, options.init);
277
- if (eventType === "dragleave")
278
- return new DragEvent(eventType, options.init);
279
- if (eventType === "dragover")
280
- return new DragEvent(eventType, options.init);
281
- if (eventType === "dragstart")
282
- return new DragEvent(eventType, options.init);
283
- if (eventType === "drop")
284
- return new DragEvent(eventType, options.init);
285
- if (eventType === "durationchange")
286
- return new Event(eventType, options.init);
287
- if (eventType === "emptied")
288
- return new Event(eventType, options.init);
289
- if (eventType === "ended")
290
- return new Event(eventType, options.init);
291
- if (eventType === "error")
292
- return new ErrorEvent(eventType, options.init);
293
- if (eventType === "focus")
294
- return new FocusEvent(eventType, options.init);
295
- if (eventType === "focusin")
296
- return new FocusEvent(eventType, options.init);
297
- if (eventType === "focusout")
298
- return new FocusEvent(eventType, options.init);
299
- if (eventType === "gotpointercapture")
300
- return new PointerEvent(eventType, options.init);
301
- if (eventType === "input")
302
- return new Event(eventType, options.init);
303
- if (eventType === "invalid")
304
- return new Event(eventType, options.init);
305
- if (eventType === "keydown")
306
- return new KeyboardEvent(eventType, options.init);
307
- if (eventType === "keypress")
308
- return new KeyboardEvent(eventType, options.init);
309
- if (eventType === "keyup")
310
- return new KeyboardEvent(eventType, options.init);
311
- if (eventType === "load")
312
- return new Event(eventType, options.init);
313
- if (eventType === "loadeddata")
314
- return new Event(eventType, options.init);
315
- if (eventType === "loadedmetadata")
316
- return new Event(eventType, options.init);
317
- if (eventType === "loadstart")
318
- return new Event(eventType, options.init);
319
- if (eventType === "lostpointercapture")
320
- return new PointerEvent(eventType, options.init);
321
- if (eventType === "mousedown")
322
- return new MouseEvent(eventType, options.init);
323
- if (eventType === "mouseenter")
324
- return new MouseEvent(eventType, options.init);
325
- if (eventType === "mouseleave")
326
- return new MouseEvent(eventType, options.init);
327
- if (eventType === "mousemove")
328
- return new MouseEvent(eventType, options.init);
329
- if (eventType === "mouseout")
330
- return new MouseEvent(eventType, options.init);
331
- if (eventType === "mouseover")
332
- return new MouseEvent(eventType, options.init);
333
- if (eventType === "mouseup")
334
- return new MouseEvent(eventType, options.init);
335
- if (eventType === "pause")
336
- return new Event(eventType, options.init);
337
- if (eventType === "play")
338
- return new Event(eventType, options.init);
339
- if (eventType === "playing")
340
- return new Event(eventType, options.init);
341
- if (eventType === "pointercancel")
342
- return new PointerEvent(eventType, options.init);
343
- if (eventType === "pointerdown")
344
- return new PointerEvent(eventType, options.init);
345
- if (eventType === "pointerenter")
346
- return new PointerEvent(eventType, options.init);
347
- if (eventType === "pointerleave")
348
- return new PointerEvent(eventType, options.init);
349
- if (eventType === "pointermove")
350
- return new PointerEvent(eventType, options.init);
351
- if (eventType === "pointerout")
352
- return new PointerEvent(eventType, options.init);
353
- if (eventType === "pointerover")
354
- return new PointerEvent(eventType, options.init);
355
- if (eventType === "pointerup")
356
- return new PointerEvent(eventType, options.init);
357
- if (eventType === "progress")
358
- return new ProgressEvent(eventType, options.init);
359
- if (eventType === "ratechange")
360
- return new Event(eventType, options.init);
361
- if (eventType === "reset")
362
- return new Event(eventType, options.init);
363
- if (eventType === "scroll")
364
- return new Event(eventType, options.init);
365
- if (eventType === "securitypolicyviolation")
366
- return new SecurityPolicyViolationEvent(eventType, options.init);
367
- if (eventType === "seeked")
368
- return new Event(eventType, options.init);
369
- if (eventType === "seeking")
370
- return new Event(eventType, options.init);
371
- if (eventType === "select")
372
- return new Event(eventType, options.init);
373
- if (eventType === "selectionchange")
374
- return new Event(eventType, options.init);
375
- if (eventType === "selectstart")
376
- return new Event(eventType, options.init);
377
- if (eventType === "stalled")
378
- return new Event(eventType, options.init);
379
- if (eventType === "submit")
380
- return new Event(eventType, options.init);
381
- if (eventType === "suspend")
382
- return new Event(eventType, options.init);
383
- if (eventType === "timeupdate")
384
- return new Event(eventType, options.init);
385
- if (eventType === "toggle")
386
- return new Event(eventType, options.init);
387
- if (eventType === "touchcancel")
388
- return new TouchEvent(eventType, options.init);
389
- if (eventType === "touchend")
390
- return new TouchEvent(eventType, options.init);
391
- if (eventType === "touchmove")
392
- return new TouchEvent(eventType, options.init);
393
- if (eventType === "touchstart")
394
- return new TouchEvent(eventType, options.init);
395
- if (eventType === "transitioncancel")
396
- return new TransitionEvent(eventType, options.init);
397
- if (eventType === "transitionend")
398
- return new TransitionEvent(eventType, options.init);
399
- if (eventType === "transitionrun")
400
- return new TransitionEvent(eventType, options.init);
401
- if (eventType === "transitionstart")
402
- return new TransitionEvent(eventType, options.init);
403
- if (eventType === "volumechange")
404
- return new Event(eventType, options.init);
405
- if (eventType === "waiting")
406
- return new Event(eventType, options.init);
407
- if (eventType === "wheel")
408
- return new WheelEvent(eventType, options.init);
409
- if (eventType === "copy")
410
- return new ClipboardEvent(eventType, options.init);
411
- if (eventType === "cut")
412
- return new ClipboardEvent(eventType, options.init);
413
- if (eventType === "paste")
414
- return new ClipboardEvent(eventType, options.init);
415
- if (eventType === "fullscreenchange")
416
- return new Event(eventType, options.init);
417
- if (eventType === "fullscreenerror")
418
- return new Event(eventType, options.init);
419
- if (eventType === "pointerlockchange")
420
- return new Event(eventType, options.init);
421
- if (eventType === "pointerlockerror")
422
- return new Event(eventType, options.init);
423
- if (eventType === "readystatechange")
424
- return new Event(eventType, options.init);
425
- if (eventType === "visibilitychange")
426
- return new Event(eventType, options.init);
427
- }
428
- }
429
197
  function toKey(name) {
430
198
  return name in keysByName ? keysByName[name] : name;
431
199
  }
@@ -523,20 +291,6 @@ const modifiersByAlias = {
523
291
  opt: "alt",
524
292
  option: "alt"
525
293
  };
526
- function toModifierFlag(modifierOrAlias) {
527
- return flagsByModifierOrAlias[modifierOrAlias];
528
- }
529
- const flagsByModifierOrAlias = {
530
- shift: "shiftKey",
531
- cmd: "metaKey",
532
- command: "metaKey",
533
- meta: "metaKey",
534
- ctrl: "ctrlKey",
535
- control: "ctrlKey",
536
- alt: "altKey",
537
- opt: "altKey",
538
- option: "altKey"
539
- };
540
294
  function createExceptAndOnlyEffect(effect, options) {
541
295
  const { except = [], only = [] } = options;
542
296
  return (event) => {
@@ -652,7 +406,7 @@ class Recognizeable {
652
406
  }
653
407
  recognize(sequenceItem, { onRecognized } = {}) {
654
408
  this.recognizing();
655
- const type = this.toType(sequenceItem), excess = isNumber(this.maxSequenceLength) ? Math.max(0, this.sequence.length - this.maxSequenceLength) : 0, newSequence = createConcat(createSlice({ from: excess })(this.sequence), [sequenceItem])([]);
409
+ const type = this.toType(sequenceItem), excess = isNumber(this.maxSequenceLength) ? Math.max(0, this.sequence.length - this.maxSequenceLength) : 0, newSequence = createConcat(createSlice(excess)(this.sequence), [sequenceItem])([]);
656
410
  this.effectApi.sequenceItem = sequenceItem;
657
411
  this.effectApi.getSequence = () => newSequence;
658
412
  this.effectApi.onRecognized = onRecognized || (() => {
@@ -1857,7 +1611,7 @@ function toInterpolated({ previous, next, progress }, options = {}) {
1857
1611
  }
1858
1612
  if (isArray(previous) && isArray(next)) {
1859
1613
  const exactSliceEnd = (next.length - previous.length) * progress + previous.length, nextIsLonger = next.length > previous.length, sliceEnd = nextIsLonger ? Math.floor(exactSliceEnd) : Math.ceil(exactSliceEnd), sliceTarget = nextIsLonger ? next : previous;
1860
- return createSlice({ from: 0, to: sliceEnd })(sliceTarget);
1614
+ return createSlice(0, sliceEnd)(sliceTarget);
1861
1615
  }
1862
1616
  }
1863
1617
  const linear = [
@@ -2257,10 +2011,10 @@ class Copyable {
2257
2011
  }
2258
2012
  computedResponse;
2259
2013
  computedError;
2260
- async copy(options = { type: "clipboard" }) {
2014
+ async copy(options = { kind: "clipboard" }) {
2261
2015
  this.copying();
2262
- const { type } = options;
2263
- switch (type) {
2016
+ const { kind } = options;
2017
+ switch (kind) {
2264
2018
  case "clipboard":
2265
2019
  try {
2266
2020
  this.computedResponse = await navigator.clipboard.writeText(this.string);
@@ -2448,44 +2202,6 @@ class Delayable {
2448
2202
  }
2449
2203
  }
2450
2204
 
2451
- class Dispatchable {
2452
- constructor(type, options = {}) {
2453
- this.setType(type);
2454
- this.ready();
2455
- }
2456
- computedStatus;
2457
- ready() {
2458
- this.computedStatus = "ready";
2459
- }
2460
- get type() {
2461
- return this.computedType;
2462
- }
2463
- set type(type) {
2464
- this.setType(type);
2465
- }
2466
- get cancelled() {
2467
- return this.computedCancelled;
2468
- }
2469
- get status() {
2470
- return this.computedStatus;
2471
- }
2472
- computedType;
2473
- setType(type) {
2474
- this.computedType = type;
2475
- return this;
2476
- }
2477
- computedCancelled;
2478
- dispatch(options = {}) {
2479
- const { target = window, ...rest } = options, event = toEvent(this.type, rest);
2480
- this.computedCancelled = !target.dispatchEvent(event);
2481
- this.dispatched();
2482
- return this;
2483
- }
2484
- dispatched() {
2485
- this.computedStatus = "dispatched";
2486
- }
2487
- }
2488
-
2489
2205
  const defaultOptions$3 = {
2490
2206
  toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
2491
2207
  };
@@ -3063,9 +2779,9 @@ class Pickable {
3063
2779
  return possibleWithoutDuplicates;
3064
2780
  }
3065
2781
  if (possibleWithoutDuplicates.length > this.picks.length) {
3066
- return createSlice({ from: possibleWithoutDuplicates.length - this.picks.length })(possibleWithoutDuplicates);
2782
+ return createSlice(possibleWithoutDuplicates.length - this.picks.length)(possibleWithoutDuplicates);
3067
2783
  }
3068
- return new Pipeable(this.picks).pipe(createSlice({ from: possibleWithoutDuplicates.length }), createConcat(possibleWithoutDuplicates));
2784
+ return new Pipeable(this.picks).pipe(createSlice(possibleWithoutDuplicates.length), createConcat(possibleWithoutDuplicates));
3069
2785
  case "lifo":
3070
2786
  if (possibleWithoutDuplicates.length === 0) {
3071
2787
  return this.picks;
@@ -3074,9 +2790,9 @@ class Pickable {
3074
2790
  return possibleWithoutDuplicates;
3075
2791
  }
3076
2792
  if (possibleWithoutDuplicates.length > this.picks.length) {
3077
- return createSlice({ from: 0, to: possibleWithoutDuplicates.length - this.picks.length + 1 })(possibleWithoutDuplicates);
2793
+ return createSlice(0, possibleWithoutDuplicates.length - this.picks.length + 1)(possibleWithoutDuplicates);
3078
2794
  }
3079
- return new Pipeable(this.picks).pipe(createSlice({ from: 0, to: this.picks.length - possibleWithoutDuplicates.length }), createConcat(possibleWithoutDuplicates));
2795
+ return new Pipeable(this.picks).pipe(createSlice(0, this.picks.length - possibleWithoutDuplicates.length), createConcat(possibleWithoutDuplicates));
3080
2796
  }
3081
2797
  });
3082
2798
  this.computedFirst = Math.min(...this.picks);
@@ -3087,7 +2803,7 @@ class Pickable {
3087
2803
  picked() {
3088
2804
  this.computedStatus = "picked";
3089
2805
  }
3090
- omit(indexOrIndices) {
2806
+ omit(indexOrIndices, options = { reference: "array" }) {
3091
2807
  if (isUndefined(indexOrIndices)) {
3092
2808
  this.computedPicks = [];
3093
2809
  this.computedFirst = void 0;
@@ -3096,7 +2812,7 @@ class Pickable {
3096
2812
  return this;
3097
2813
  }
3098
2814
  const omits = ensureIndices(indexOrIndices);
3099
- this.computedPicks = createFilter((pick) => isUndefined(lazyCollections.find((omit) => pick === omit)(omits)))(this.computedPicks);
2815
+ this.computedPicks = createFilter((pick, index) => options.reference === "array" ? isUndefined(lazyCollections.find((omit) => pick === omit)(omits)) : isUndefined(lazyCollections.find((omit) => index === omit)(omits)))(this.computedPicks);
3100
2816
  this.computedFirst = Math.min(...this.picks);
3101
2817
  this.computedLast = Math.max(...this.picks);
3102
2818
  this.omitted();
@@ -3204,15 +2920,15 @@ class Searchable {
3204
2920
  }
3205
2921
 
3206
2922
  const defaultOptions = {
3207
- type: "local",
2923
+ kind: "local",
3208
2924
  statusKeySuffix: " status"
3209
2925
  };
3210
2926
  class Storeable {
3211
- type;
2927
+ kind;
3212
2928
  statusKeySuffix;
3213
2929
  constructor(key, options = {}) {
3214
2930
  this.constructing();
3215
- this.type = options.type ?? defaultOptions.type;
2931
+ this.kind = options.kind ?? defaultOptions.kind;
3216
2932
  this.statusKeySuffix = options.statusKeySuffix ?? defaultOptions.statusKeySuffix;
3217
2933
  this.setKey(key);
3218
2934
  this.ready();
@@ -3245,7 +2961,7 @@ class Storeable {
3245
2961
  return this.computedStatus;
3246
2962
  }
3247
2963
  get storage() {
3248
- switch (this.type) {
2964
+ switch (this.kind) {
3249
2965
  case "local":
3250
2966
  return localStorage;
3251
2967
  case "session":
@@ -3328,7 +3044,6 @@ exports.Animateable = Animateable;
3328
3044
  exports.Completeable = Completeable;
3329
3045
  exports.Copyable = Copyable;
3330
3046
  exports.Delayable = Delayable;
3331
- exports.Dispatchable = Dispatchable;
3332
3047
  exports.Drawable = Drawable;
3333
3048
  exports.Fetchable = Fetchable;
3334
3049
  exports.Fullscreenable = Fullscreenable;
@@ -3361,6 +3076,7 @@ exports.createReplace = createReplace;
3361
3076
  exports.createReverse = createReverse;
3362
3077
  exports.createSlice = createSlice;
3363
3078
  exports.createSlug = createSlug;
3079
+ exports.createSort = createSort;
3364
3080
  exports.createSwap = createSwap;
3365
3081
  exports.createToEntries = createToEntries;
3366
3082
  exports.createUnique = createUnique;