@vueuse/shared 9.12.0 → 10.0.0-beta.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.
package/index.cjs CHANGED
@@ -2,31 +2,31 @@
2
2
 
3
3
  var vueDemi = require('vue-demi');
4
4
 
5
- var __defProp$9 = Object.defineProperty;
6
- var __defProps$6 = Object.defineProperties;
7
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
8
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
9
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
10
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues$9 = (a, b) => {
5
+ var __defProp$b = Object.defineProperty;
6
+ var __defProps$8 = Object.defineProperties;
7
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues$b = (a, b) => {
13
13
  for (var prop in b || (b = {}))
14
- if (__hasOwnProp$b.call(b, prop))
15
- __defNormalProp$9(a, prop, b[prop]);
16
- if (__getOwnPropSymbols$b)
17
- for (var prop of __getOwnPropSymbols$b(b)) {
18
- if (__propIsEnum$b.call(b, prop))
19
- __defNormalProp$9(a, prop, b[prop]);
14
+ if (__hasOwnProp$d.call(b, prop))
15
+ __defNormalProp$b(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols$d)
17
+ for (var prop of __getOwnPropSymbols$d(b)) {
18
+ if (__propIsEnum$d.call(b, prop))
19
+ __defNormalProp$b(a, prop, b[prop]);
20
20
  }
21
21
  return a;
22
22
  };
23
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
23
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
24
24
  function computedEager(fn, options) {
25
25
  var _a;
26
26
  const result = vueDemi.shallowRef();
27
27
  vueDemi.watchEffect(() => {
28
28
  result.value = fn();
29
- }, __spreadProps$6(__spreadValues$9({}, options), {
29
+ }, __spreadProps$8(__spreadValues$b({}, options), {
30
30
  flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
31
31
  }));
32
32
  return vueDemi.readonly(result);
@@ -144,14 +144,14 @@ function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = fa
144
144
  lastExec = Date.now();
145
145
  invoke();
146
146
  } else if (trailing) {
147
- return new Promise((resolve, reject) => {
147
+ lastValue = new Promise((resolve, reject) => {
148
148
  lastRejector = rejectOnCancel ? reject : resolve;
149
149
  timer = setTimeout(() => {
150
150
  lastExec = Date.now();
151
151
  isLeading = true;
152
152
  resolve(invoke());
153
153
  clear();
154
- }, duration - elapsed);
154
+ }, Math.max(0, duration - elapsed));
155
155
  });
156
156
  }
157
157
  if (!leading && !timer)
@@ -244,6 +244,9 @@ function objectPick(obj, keys, omitUndefined = false) {
244
244
  return n;
245
245
  }, {});
246
246
  }
247
+ function objectEntries(obj) {
248
+ return Object.entries(obj);
249
+ }
247
250
 
248
251
  function computedWithControl(source, fn) {
249
252
  let v = void 0;
@@ -288,14 +291,12 @@ function tryOnScopeDispose(fn) {
288
291
  }
289
292
 
290
293
  function createEventHook() {
291
- const fns = [];
294
+ const fns = new Set();
292
295
  const off = (fn) => {
293
- const index = fns.indexOf(fn);
294
- if (index !== -1)
295
- fns.splice(index, 1);
296
+ fns.delete(fn);
296
297
  };
297
298
  const on = (fn) => {
298
- fns.push(fn);
299
+ fns.add(fn);
299
300
  const offFn = () => off(fn);
300
301
  tryOnScopeDispose(offFn);
301
302
  return {
@@ -303,7 +304,7 @@ function createEventHook() {
303
304
  };
304
305
  };
305
306
  const trigger = (param) => {
306
- fns.forEach((fn) => fn(param));
307
+ return Promise.all(Array.from(fns).map((fn) => fn(param)));
307
308
  };
308
309
  return {
309
310
  on,
@@ -316,9 +317,9 @@ function createGlobalState(stateFactory) {
316
317
  let initialized = false;
317
318
  let state;
318
319
  const scope = vueDemi.effectScope(true);
319
- return () => {
320
+ return (...args) => {
320
321
  if (!initialized) {
321
- state = scope.run(stateFactory);
322
+ state = scope.run(() => stateFactory(...args));
322
323
  initialized = true;
323
324
  }
324
325
  return state;
@@ -391,25 +392,25 @@ function isDefined(v) {
391
392
  return vueDemi.unref(v) != null;
392
393
  }
393
394
 
394
- var __defProp$8 = Object.defineProperty;
395
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
396
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
397
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
398
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
399
- var __spreadValues$8 = (a, b) => {
395
+ var __defProp$a = Object.defineProperty;
396
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
397
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
398
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
399
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
400
+ var __spreadValues$a = (a, b) => {
400
401
  for (var prop in b || (b = {}))
401
- if (__hasOwnProp$a.call(b, prop))
402
- __defNormalProp$8(a, prop, b[prop]);
403
- if (__getOwnPropSymbols$a)
404
- for (var prop of __getOwnPropSymbols$a(b)) {
405
- if (__propIsEnum$a.call(b, prop))
406
- __defNormalProp$8(a, prop, b[prop]);
402
+ if (__hasOwnProp$c.call(b, prop))
403
+ __defNormalProp$a(a, prop, b[prop]);
404
+ if (__getOwnPropSymbols$c)
405
+ for (var prop of __getOwnPropSymbols$c(b)) {
406
+ if (__propIsEnum$c.call(b, prop))
407
+ __defNormalProp$a(a, prop, b[prop]);
407
408
  }
408
409
  return a;
409
410
  };
410
411
  function makeDestructurable(obj, arr) {
411
412
  if (typeof Symbol !== "undefined") {
412
- const clone = __spreadValues$8({}, obj);
413
+ const clone = __spreadValues$a({}, obj);
413
414
  Object.defineProperty(clone, Symbol.iterator, {
414
415
  enumerable: false,
415
416
  value() {
@@ -672,25 +673,25 @@ function syncRefs(source, targets, options = {}) {
672
673
  return vueDemi.watch(source, (newValue) => targets.forEach((target) => target.value = newValue), { flush, deep, immediate });
673
674
  }
674
675
 
675
- var __defProp$7 = Object.defineProperty;
676
- var __defProps$5 = Object.defineProperties;
677
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
678
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
679
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
680
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
681
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
682
- var __spreadValues$7 = (a, b) => {
676
+ var __defProp$9 = Object.defineProperty;
677
+ var __defProps$7 = Object.defineProperties;
678
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
679
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
680
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
681
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
682
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
683
+ var __spreadValues$9 = (a, b) => {
683
684
  for (var prop in b || (b = {}))
684
- if (__hasOwnProp$9.call(b, prop))
685
- __defNormalProp$7(a, prop, b[prop]);
686
- if (__getOwnPropSymbols$9)
687
- for (var prop of __getOwnPropSymbols$9(b)) {
688
- if (__propIsEnum$9.call(b, prop))
689
- __defNormalProp$7(a, prop, b[prop]);
685
+ if (__hasOwnProp$b.call(b, prop))
686
+ __defNormalProp$9(a, prop, b[prop]);
687
+ if (__getOwnPropSymbols$b)
688
+ for (var prop of __getOwnPropSymbols$b(b)) {
689
+ if (__propIsEnum$b.call(b, prop))
690
+ __defNormalProp$9(a, prop, b[prop]);
690
691
  }
691
692
  return a;
692
693
  };
693
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
694
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
694
695
  function toRefs(objectRef) {
695
696
  if (!vueDemi.isRef(objectRef))
696
697
  return vueDemi.toRefs(objectRef);
@@ -706,7 +707,7 @@ function toRefs(objectRef) {
706
707
  copy[key] = v;
707
708
  objectRef.value = copy;
708
709
  } else {
709
- const newObject = __spreadProps$5(__spreadValues$7({}, objectRef.value), { [key]: v });
710
+ const newObject = __spreadProps$7(__spreadValues$9({}, objectRef.value), { [key]: v });
710
711
  Object.setPrototypeOf(newObject, objectRef.value);
711
712
  objectRef.value = newObject;
712
713
  }
@@ -851,6 +852,19 @@ function until(r) {
851
852
  return createUntil(r);
852
853
  }
853
854
 
855
+ const defaultComparator = (value, othVal) => value === othVal;
856
+ function useArrayDifference(...args) {
857
+ var _a;
858
+ const list = args[0];
859
+ const values = args[1];
860
+ let compareFn = (_a = args[2]) != null ? _a : defaultComparator;
861
+ if (isString(compareFn)) {
862
+ const key = compareFn;
863
+ compareFn = (value, othVal) => value[key] === othVal[key];
864
+ }
865
+ return vueDemi.computed(() => resolveUnref(list).filter((x) => !resolveUnref(values).find((y) => compareFn(x, y))));
866
+ }
867
+
854
868
  function useArrayEvery(list, fn) {
855
869
  return vueDemi.computed(() => resolveUnref(list).every((element, index, array) => fn(resolveUnref(element), index, array)));
856
870
  }
@@ -867,6 +881,39 @@ function useArrayFindIndex(list, fn) {
867
881
  return vueDemi.computed(() => resolveUnref(list).findIndex((element, index, array) => fn(resolveUnref(element), index, array)));
868
882
  }
869
883
 
884
+ function findLast(arr, cb) {
885
+ let index = arr.length;
886
+ while (index-- > 0) {
887
+ if (cb(arr[index], index, arr))
888
+ return arr[index];
889
+ }
890
+ return void 0;
891
+ }
892
+ function useArrayFindLast(list, fn) {
893
+ return vueDemi.computed(() => resolveUnref(!Array.prototype.findLast ? findLast(resolveUnref(list), (element, index, array) => fn(resolveUnref(element), index, array)) : resolveUnref(list).findLast((element, index, array) => fn(resolveUnref(element), index, array))));
894
+ }
895
+
896
+ function isArrayIncludesOptions(obj) {
897
+ return isObject(obj) && containsProp(obj, "formIndex", "comparator");
898
+ }
899
+ function useArrayIncludes(...args) {
900
+ var _a;
901
+ const list = args[0];
902
+ const value = args[1];
903
+ let comparator = args[2];
904
+ let formIndex = 0;
905
+ if (isArrayIncludesOptions(comparator)) {
906
+ formIndex = (_a = comparator.fromIndex) != null ? _a : 0;
907
+ comparator = comparator.comparator;
908
+ }
909
+ if (typeof comparator === "string") {
910
+ const key = comparator;
911
+ comparator = (element, value2) => element[key] === resolveUnref(value2);
912
+ }
913
+ comparator = comparator != null ? comparator : (element, value2) => element === resolveUnref(value2);
914
+ return vueDemi.computed(() => resolveUnref(list).slice(formIndex).some((element, index, array) => comparator(resolveUnref(element), resolveUnref(value), index, resolveUnref(array))));
915
+ }
916
+
870
917
  function useArrayJoin(list, separator) {
871
918
  return vueDemi.computed(() => resolveUnref(list).map((i) => resolveUnref(i)).join(resolveUnref(separator)));
872
919
  }
@@ -1021,19 +1068,19 @@ function useIntervalFn(cb, interval = 1e3, options = {}) {
1021
1068
  };
1022
1069
  }
1023
1070
 
1024
- var __defProp$6 = Object.defineProperty;
1025
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1026
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1027
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1028
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1029
- var __spreadValues$6 = (a, b) => {
1071
+ var __defProp$8 = Object.defineProperty;
1072
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1073
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1074
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1075
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1076
+ var __spreadValues$8 = (a, b) => {
1030
1077
  for (var prop in b || (b = {}))
1031
- if (__hasOwnProp$8.call(b, prop))
1032
- __defNormalProp$6(a, prop, b[prop]);
1033
- if (__getOwnPropSymbols$8)
1034
- for (var prop of __getOwnPropSymbols$8(b)) {
1035
- if (__propIsEnum$8.call(b, prop))
1036
- __defNormalProp$6(a, prop, b[prop]);
1078
+ if (__hasOwnProp$a.call(b, prop))
1079
+ __defNormalProp$8(a, prop, b[prop]);
1080
+ if (__getOwnPropSymbols$a)
1081
+ for (var prop of __getOwnPropSymbols$a(b)) {
1082
+ if (__propIsEnum$a.call(b, prop))
1083
+ __defNormalProp$8(a, prop, b[prop]);
1037
1084
  }
1038
1085
  return a;
1039
1086
  };
@@ -1045,13 +1092,17 @@ function useInterval(interval = 1e3, options = {}) {
1045
1092
  } = options;
1046
1093
  const counter = vueDemi.ref(0);
1047
1094
  const update = () => counter.value += 1;
1095
+ const reset = () => {
1096
+ counter.value = 0;
1097
+ };
1048
1098
  const controls = useIntervalFn(callback ? () => {
1049
1099
  update();
1050
1100
  callback(counter.value);
1051
1101
  } : update, interval, { immediate });
1052
1102
  if (exposeControls) {
1053
- return __spreadValues$6({
1054
- counter
1103
+ return __spreadValues$8({
1104
+ counter,
1105
+ reset
1055
1106
  }, controls);
1056
1107
  } else {
1057
1108
  return counter;
@@ -1103,19 +1154,19 @@ function useTimeoutFn(cb, interval, options = {}) {
1103
1154
  };
1104
1155
  }
1105
1156
 
1106
- var __defProp$5 = Object.defineProperty;
1107
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1108
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1109
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1110
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1111
- var __spreadValues$5 = (a, b) => {
1157
+ var __defProp$7 = Object.defineProperty;
1158
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1159
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1160
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1161
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1162
+ var __spreadValues$7 = (a, b) => {
1112
1163
  for (var prop in b || (b = {}))
1113
- if (__hasOwnProp$7.call(b, prop))
1114
- __defNormalProp$5(a, prop, b[prop]);
1115
- if (__getOwnPropSymbols$7)
1116
- for (var prop of __getOwnPropSymbols$7(b)) {
1117
- if (__propIsEnum$7.call(b, prop))
1118
- __defNormalProp$5(a, prop, b[prop]);
1164
+ if (__hasOwnProp$9.call(b, prop))
1165
+ __defNormalProp$7(a, prop, b[prop]);
1166
+ if (__getOwnPropSymbols$9)
1167
+ for (var prop of __getOwnPropSymbols$9(b)) {
1168
+ if (__propIsEnum$9.call(b, prop))
1169
+ __defNormalProp$7(a, prop, b[prop]);
1119
1170
  }
1120
1171
  return a;
1121
1172
  };
@@ -1127,7 +1178,7 @@ function useTimeout(interval = 1e3, options = {}) {
1127
1178
  const controls = useTimeoutFn(callback != null ? callback : noop, interval, options);
1128
1179
  const ready = vueDemi.computed(() => !controls.isPending.value);
1129
1180
  if (exposeControls) {
1130
- return __spreadValues$5({
1181
+ return __spreadValues$7({
1131
1182
  ready
1132
1183
  }, controls);
1133
1184
  } else {
@@ -1203,17 +1254,17 @@ function watchArray(source, cb, options) {
1203
1254
  }, options);
1204
1255
  }
1205
1256
 
1206
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1207
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1208
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1257
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1258
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1259
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1209
1260
  var __objRest$5 = (source, exclude) => {
1210
1261
  var target = {};
1211
1262
  for (var prop in source)
1212
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1263
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1213
1264
  target[prop] = source[prop];
1214
- if (source != null && __getOwnPropSymbols$6)
1215
- for (var prop of __getOwnPropSymbols$6(source)) {
1216
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1265
+ if (source != null && __getOwnPropSymbols$8)
1266
+ for (var prop of __getOwnPropSymbols$8(source)) {
1267
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1217
1268
  target[prop] = source[prop];
1218
1269
  }
1219
1270
  return target;
@@ -1227,17 +1278,17 @@ function watchWithFilter(source, cb, options = {}) {
1227
1278
  return vueDemi.watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
1228
1279
  }
1229
1280
 
1230
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1231
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1232
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1281
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1282
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1283
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1233
1284
  var __objRest$4 = (source, exclude) => {
1234
1285
  var target = {};
1235
1286
  for (var prop in source)
1236
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1287
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1237
1288
  target[prop] = source[prop];
1238
- if (source != null && __getOwnPropSymbols$5)
1239
- for (var prop of __getOwnPropSymbols$5(source)) {
1240
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1289
+ if (source != null && __getOwnPropSymbols$7)
1290
+ for (var prop of __getOwnPropSymbols$7(source)) {
1291
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1241
1292
  target[prop] = source[prop];
1242
1293
  }
1243
1294
  return target;
@@ -1258,33 +1309,33 @@ function watchAtMost(source, cb, options) {
1258
1309
  return { count: current, stop };
1259
1310
  }
1260
1311
 
1261
- var __defProp$4 = Object.defineProperty;
1262
- var __defProps$4 = Object.defineProperties;
1263
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1264
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1265
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1266
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1267
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1268
- var __spreadValues$4 = (a, b) => {
1312
+ var __defProp$6 = Object.defineProperty;
1313
+ var __defProps$6 = Object.defineProperties;
1314
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1315
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1316
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1317
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1318
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1319
+ var __spreadValues$6 = (a, b) => {
1269
1320
  for (var prop in b || (b = {}))
1270
- if (__hasOwnProp$4.call(b, prop))
1271
- __defNormalProp$4(a, prop, b[prop]);
1272
- if (__getOwnPropSymbols$4)
1273
- for (var prop of __getOwnPropSymbols$4(b)) {
1274
- if (__propIsEnum$4.call(b, prop))
1275
- __defNormalProp$4(a, prop, b[prop]);
1321
+ if (__hasOwnProp$6.call(b, prop))
1322
+ __defNormalProp$6(a, prop, b[prop]);
1323
+ if (__getOwnPropSymbols$6)
1324
+ for (var prop of __getOwnPropSymbols$6(b)) {
1325
+ if (__propIsEnum$6.call(b, prop))
1326
+ __defNormalProp$6(a, prop, b[prop]);
1276
1327
  }
1277
1328
  return a;
1278
1329
  };
1279
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1330
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1280
1331
  var __objRest$3 = (source, exclude) => {
1281
1332
  var target = {};
1282
1333
  for (var prop in source)
1283
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1334
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1284
1335
  target[prop] = source[prop];
1285
- if (source != null && __getOwnPropSymbols$4)
1286
- for (var prop of __getOwnPropSymbols$4(source)) {
1287
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1336
+ if (source != null && __getOwnPropSymbols$6)
1337
+ for (var prop of __getOwnPropSymbols$6(source)) {
1338
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1288
1339
  target[prop] = source[prop];
1289
1340
  }
1290
1341
  return target;
@@ -1297,38 +1348,66 @@ function watchDebounced(source, cb, options = {}) {
1297
1348
  "debounce",
1298
1349
  "maxWait"
1299
1350
  ]);
1300
- return watchWithFilter(source, cb, __spreadProps$4(__spreadValues$4({}, watchOptions), {
1351
+ return watchWithFilter(source, cb, __spreadProps$6(__spreadValues$6({}, watchOptions), {
1301
1352
  eventFilter: debounceFilter(debounce, { maxWait })
1302
1353
  }));
1303
1354
  }
1304
1355
 
1305
- var __defProp$3 = Object.defineProperty;
1306
- var __defProps$3 = Object.defineProperties;
1307
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1308
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1309
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1310
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1311
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1312
- var __spreadValues$3 = (a, b) => {
1356
+ var __defProp$5 = Object.defineProperty;
1357
+ var __defProps$5 = Object.defineProperties;
1358
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1359
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1360
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1361
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1362
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1363
+ var __spreadValues$5 = (a, b) => {
1313
1364
  for (var prop in b || (b = {}))
1314
- if (__hasOwnProp$3.call(b, prop))
1315
- __defNormalProp$3(a, prop, b[prop]);
1316
- if (__getOwnPropSymbols$3)
1317
- for (var prop of __getOwnPropSymbols$3(b)) {
1318
- if (__propIsEnum$3.call(b, prop))
1319
- __defNormalProp$3(a, prop, b[prop]);
1365
+ if (__hasOwnProp$5.call(b, prop))
1366
+ __defNormalProp$5(a, prop, b[prop]);
1367
+ if (__getOwnPropSymbols$5)
1368
+ for (var prop of __getOwnPropSymbols$5(b)) {
1369
+ if (__propIsEnum$5.call(b, prop))
1370
+ __defNormalProp$5(a, prop, b[prop]);
1320
1371
  }
1321
1372
  return a;
1322
1373
  };
1323
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1374
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1375
+ function watchDeep(source, cb, options) {
1376
+ return vueDemi.watch(source, (v, ov, onInvalidate) => {
1377
+ if (v)
1378
+ cb(v, ov, onInvalidate);
1379
+ }, __spreadProps$5(__spreadValues$5({}, options), {
1380
+ deep: true
1381
+ }));
1382
+ }
1383
+
1384
+ var __defProp$4 = Object.defineProperty;
1385
+ var __defProps$4 = Object.defineProperties;
1386
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1387
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1388
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1389
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1390
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1391
+ var __spreadValues$4 = (a, b) => {
1392
+ for (var prop in b || (b = {}))
1393
+ if (__hasOwnProp$4.call(b, prop))
1394
+ __defNormalProp$4(a, prop, b[prop]);
1395
+ if (__getOwnPropSymbols$4)
1396
+ for (var prop of __getOwnPropSymbols$4(b)) {
1397
+ if (__propIsEnum$4.call(b, prop))
1398
+ __defNormalProp$4(a, prop, b[prop]);
1399
+ }
1400
+ return a;
1401
+ };
1402
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1324
1403
  var __objRest$2 = (source, exclude) => {
1325
1404
  var target = {};
1326
1405
  for (var prop in source)
1327
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1406
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1328
1407
  target[prop] = source[prop];
1329
- if (source != null && __getOwnPropSymbols$3)
1330
- for (var prop of __getOwnPropSymbols$3(source)) {
1331
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1408
+ if (source != null && __getOwnPropSymbols$4)
1409
+ for (var prop of __getOwnPropSymbols$4(source)) {
1410
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1332
1411
  target[prop] = source[prop];
1333
1412
  }
1334
1413
  return target;
@@ -1365,7 +1444,7 @@ function watchIgnorable(source, cb, options = {}) {
1365
1444
  };
1366
1445
  disposables.push(vueDemi.watch(source, () => {
1367
1446
  syncCounter.value++;
1368
- }, __spreadProps$3(__spreadValues$3({}, watchOptions), { flush: "sync" })));
1447
+ }, __spreadProps$4(__spreadValues$4({}, watchOptions), { flush: "sync" })));
1369
1448
  ignoreUpdates = (updater) => {
1370
1449
  const syncCounterPrev = syncCounter.value;
1371
1450
  updater();
@@ -1386,6 +1465,34 @@ function watchIgnorable(source, cb, options = {}) {
1386
1465
  return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
1387
1466
  }
1388
1467
 
1468
+ var __defProp$3 = Object.defineProperty;
1469
+ var __defProps$3 = Object.defineProperties;
1470
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1471
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1472
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1473
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1474
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1475
+ var __spreadValues$3 = (a, b) => {
1476
+ for (var prop in b || (b = {}))
1477
+ if (__hasOwnProp$3.call(b, prop))
1478
+ __defNormalProp$3(a, prop, b[prop]);
1479
+ if (__getOwnPropSymbols$3)
1480
+ for (var prop of __getOwnPropSymbols$3(b)) {
1481
+ if (__propIsEnum$3.call(b, prop))
1482
+ __defNormalProp$3(a, prop, b[prop]);
1483
+ }
1484
+ return a;
1485
+ };
1486
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1487
+ function watchImmediate(source, cb, options) {
1488
+ return vueDemi.watch(source, (v, ov, onInvalidate) => {
1489
+ if (v)
1490
+ cb(v, ov, onInvalidate);
1491
+ }, __spreadProps$3(__spreadValues$3({}, options), {
1492
+ immediate: true
1493
+ }));
1494
+ }
1495
+
1389
1496
  function watchOnce(source, cb, options) {
1390
1497
  const stop = vueDemi.watch(source, (...args) => {
1391
1498
  vueDemi.nextTick(() => stop());
@@ -1597,6 +1704,7 @@ exports.makeDestructurable = makeDestructurable;
1597
1704
  exports.noop = noop;
1598
1705
  exports.normalizeDate = normalizeDate;
1599
1706
  exports.now = now;
1707
+ exports.objectEntries = objectEntries;
1600
1708
  exports.objectPick = objectPick;
1601
1709
  exports.pausableFilter = pausableFilter;
1602
1710
  exports.pausableWatch = watchPausable;
@@ -1629,10 +1737,13 @@ exports.tryOnMounted = tryOnMounted;
1629
1737
  exports.tryOnScopeDispose = tryOnScopeDispose;
1630
1738
  exports.tryOnUnmounted = tryOnUnmounted;
1631
1739
  exports.until = until;
1740
+ exports.useArrayDifference = useArrayDifference;
1632
1741
  exports.useArrayEvery = useArrayEvery;
1633
1742
  exports.useArrayFilter = useArrayFilter;
1634
1743
  exports.useArrayFind = useArrayFind;
1635
1744
  exports.useArrayFindIndex = useArrayFindIndex;
1745
+ exports.useArrayFindLast = useArrayFindLast;
1746
+ exports.useArrayIncludes = useArrayIncludes;
1636
1747
  exports.useArrayJoin = useArrayJoin;
1637
1748
  exports.useArrayMap = useArrayMap;
1638
1749
  exports.useArrayReduce = useArrayReduce;
@@ -1655,7 +1766,9 @@ exports.useToggle = useToggle;
1655
1766
  exports.watchArray = watchArray;
1656
1767
  exports.watchAtMost = watchAtMost;
1657
1768
  exports.watchDebounced = watchDebounced;
1769
+ exports.watchDeep = watchDeep;
1658
1770
  exports.watchIgnorable = watchIgnorable;
1771
+ exports.watchImmediate = watchImmediate;
1659
1772
  exports.watchOnce = watchOnce;
1660
1773
  exports.watchPausable = watchPausable;
1661
1774
  exports.watchThrottled = watchThrottled;