@tanstack/react-query 5.0.0-alpha.12 → 5.0.0-alpha.18

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.
@@ -1135,10 +1135,11 @@
1135
1135
  return [...this.#queries.values()];
1136
1136
  }
1137
1137
  find(filters) {
1138
- if (typeof filters.exact === 'undefined') {
1139
- filters.exact = true;
1140
- }
1141
- return this.getAll().find(query => matchQuery(filters, query));
1138
+ const defaultedFilters = {
1139
+ exact: true,
1140
+ ...filters
1141
+ };
1142
+ return this.getAll().find(query => matchQuery(defaultedFilters, query));
1142
1143
  }
1143
1144
  findAll(filters = {}) {
1144
1145
  const queries = this.getAll();
@@ -1444,10 +1445,11 @@
1444
1445
  return this.#mutations;
1445
1446
  }
1446
1447
  find(filters) {
1447
- if (typeof filters.exact === 'undefined') {
1448
- filters.exact = true;
1449
- }
1450
- return this.#mutations.find(mutation => matchMutation(filters, mutation));
1448
+ const defaultedFilters = {
1449
+ exact: true,
1450
+ ...filters
1451
+ };
1452
+ return this.#mutations.find(mutation => matchMutation(defaultedFilters, mutation));
1451
1453
  }
1452
1454
  findAll(filters = {}) {
1453
1455
  return this.#mutations.filter(mutation => matchMutation(filters, mutation));
@@ -1714,10 +1716,11 @@
1714
1716
  });
1715
1717
  }
1716
1718
  cancelQueries(filters = {}, cancelOptions = {}) {
1717
- if (typeof cancelOptions.revert === 'undefined') {
1718
- cancelOptions.revert = true;
1719
- }
1720
- const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map(query => query.cancel(cancelOptions)));
1719
+ const defaultedCancelOptions = {
1720
+ revert: true,
1721
+ ...cancelOptions
1722
+ };
1723
+ const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map(query => query.cancel(defaultedCancelOptions)));
1721
1724
  return Promise.all(promises).then(noop$1).catch(noop$1);
1722
1725
  }
1723
1726
  invalidateQueries(filters = {}, options = {}) {